每日随笔

今天实践了正则表达式,只能实现基本的判断

var temp = /[代码]/
var e = "";
alert("temp.test(e)");

test()
test()方法搜索字符串指定的值,根据结果并返回真或假。
下面的示例是从字符串中搜索字符 "e" :
var patt1=new RegExp("e");
document.write(patt1.test("The best things in life are free"));

posted @ 2020-10-27 21:29  不详·Christina  阅读(26)  评论(0)    收藏  举报