110,565
社区成员
发帖
与我相关
我的任务
分享
string str = "R2ABC88 123.54KR13.33wwww66R 21MR56 888.8±";
MatchCollection mColl = Regex.Matches(str, @"((?<=[^A-Za-z])([1-9]\d*\.\d*[1-9]|[1-9]\d*|0\.\d*[1-9]))?(±|R|KR|MR)([1-9]\d*\.\d*[1-9]|[1-9]\d*|0\.\d*[1-9])?");
foreach(Match m in mColl)
{
Response.Write("a=" + m.Groups[2].Value.ToString() + ",b="+m.Groups[4].Value.ToString() + "<br />");
}
string str = "R2ABC88 123.54KR13.33wwww66R 21MR56";
MatchCollection mColl = Regex.Matches(str, @"[^A-Za-z]([1-9]\d*\.\d*[1-9]|[1-9]\d*|0\.\d*[1-9])(±|R|KR|MR)([1-9]\d*\.\d*[1-9]|[1-9]\d*|0\.\d*[1-9])");
foreach(Match m in mColl)
{
Response.Write("a=" + m.Groups[1].Value.ToString() + ",b="+m.Groups[3].Value.ToString() + "<br />");
}