自已去看看手册
语法 1
re = /pattern/[flags]语法 2
re = new RegExp("pattern",["flags"]) function MatchDemo(){
var r, re; // 声明变量。
var s = "The rain in Spain falls mainly in the plain";
re = new RegExp("Spain","i"); // 创建正则表达式对象。
r = s.match(re); // 在字符串 s 中查找匹配。
return(r); // 返回匹配结果。
}
语法 1
re = /pattern/[flags]语法 2
re = new RegExp("pattern",["flags"]) function MatchDemo(){
var r, re; // 声明变量。
var s = "The rain in Spain falls mainly in the plain";
re = new RegExp("Spain","i"); // 创建正则表达式对象。
r = s.match(re); // 在字符串 s 中查找匹配。
return(r); // 返回匹配结果。
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货