要将形如url1的字符串中的数字匹配出来,假设为n,然后替换成n+1
url1
n
n+1
'url1'.replace(/\d+$/, function(n){ return ++n });
输出url2
url2
标签
查看
509 次