87,914
社区成员
发帖
与我相关
我的任务
分享
var str = "123-8test888-9hehe";
var re = /(\d{3})\-(\d)/g;
var match;
while ((match = re.exec(str)) != null)
alert([RegExp.$1, RegExp.$2]);
var str = "123-8test888-9hehe";
var match = str.match(/(\d{3})\-(\d)/g, str);
for(var i = 0; i < match.length; i++) {
alert(match[i]);
}
var p="\\d";
alert("a123".match(eval("(/" + p + "/)")));
var a=("123-8test888-9hehe".match(/(\d{3})\-(\d)/g));
alert(RegExp.$1);