110,536
社区成员
发帖
与我相关
我的任务
分享
\d+(,\d+){0,10}
\d{2}(,\d{2}){0,}
string inputstr = "01,02,03,04,05,06空间的打开UKS,07,08DDD,09,10,11";
string output = "Out:<br />";
Regex rg = new System.Text.RegularExpressions.Regex(@"\d{2}[,01|,02|,03|,04|,05|,06|,07|,08|,09|,10|,11]*");
foreach(Match m in rg.Matches(inputstr))
{
output += m.Value + "<br />";
}
Response.Write(output);
输出:
01,02,03,04,05,06
07,08
09,10,11