首页 > 代码库 > javascript的compile()函数使用

javascript的compile()函数使用

说明

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

javascript的compile()函数使用