日期:2014-05-17 浏览次数:20832 次
string test = Regex.Replace("abc1def2ghijk34mn", @"(?is)(?<=\d)
------解决方案--------------------
(?=\d)", "
------解决方案--------------------
");
string source = "abc1def2ghijk34mn";
Regex reg = new Regex(@"(?is)([\d]+)");
source = reg.Replace(source, @",$1,");
//source = "abc,1,def,2,ghijk,34,mn"
string test = Regex.Replace("abc1def2ghijk34mn", @"(?is)(?=[^\d])(?<=\d)
------解决方案--------------------
(?=\d)(?<=[^\d])", "
------解决方案--------------------
");
string source = "abc1def2ghijk34mn";
Regex reg = new Regex("(?is)([\\d]+)");
source = reg.Replace(source, ",$1,");
Regex reg = new Regex("\\d+");
string result = reg.Replace(yourStr, @"
------解决方案--------------------
$0
------解决方案--------------------
");