compile() 既可以改变检索模式,也可以添加或删除第二个参数
<html> <head> <script type="text/javascript"> var patt1=new RegExp("e"); document.write(patt1.test("The best things in life are free")); patt1.compile("d"); document.write(patt1.test("The best things in life are free")); </script> </head> <body> </body> </html>
本文出自 “素颜” 博客,请务必保留此出处http://suyanzhu.blog.51cto.com/8050189/1902366
原文地址:http://suyanzhu.blog.51cto.com/8050189/1902366