87,903
社区成员
发帖
与我相关
我的任务
分享
var url= "http://localhost:80/pro_321.asp";
var temp1 = url.match(/\d+.asp/);
document.write(temp1);
var temp = temp1.match(/\d+/);
document.write(temp);
"321.asp".match(/\d+/);
会执行,但是不能执行上一次的结果。var url= "http://localhost:80/pro_321.asp";
var temp1 = url.match(/\d+.asp/);
document.write(temp1);
var temp1 = url.match(/\d+.asp/);
if(temp1){
temp1 = temp1[0];
var temp = temp1.match(/\d+/);
document.write(temp);
}