62,041
社区成员
发帖
与我相关
我的任务
分享
string str = "baidu_{0}_{1}";
Regex rgx = new Regex(@"{\d+}");
Console.WriteLine(rgx.Matches(str).Count);
string source = "baidu_{0}_{1}";
Regex reg = new Regex(@"(?is){\d*}");
MatchCollection mc = reg.Matches(source);
MessageBox.Show(mc.Count.ToString());