每日随笔
今天实践了正则表达式,只能实现基本的判断
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"));
今天实践了正则表达式,只能实现基本的判断
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"));