首页 > 编程语言 > 详细

javascript的compile()函数使用

时间:2017-03-01 21:44:31      阅读:182      评论:0      收藏:0      [点我收藏+]

说明

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()函数使用

原文:http://suyanzhu.blog.51cto.com/8050189/1902366

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!