var url = "http://www.abc.com.cn/thread-234-19-520.html";
Regex regex = new Regex(@"(http://www.abc.com.cn/thread-)([\d]*)(-)([\d]*)(?<sub>-)([\d]*)(.html)");
var result1 = regex.Replace(url, @"$1$2$3$4${sub}1$6");
// var result2 = regex.Replace(url, @"1$7");
Console.WriteLine(result1);
Console.ReadKey();
"http://bbs.abc.com.cn/thread-321-5-258.html".replace(/(-\d+)+/,function(a,b) {
return a.replace(b,"-1");
});
谢谢,我需要的是C#实现,不过也谢谢您