string p = @"(^S[0-9]{10}$)";
Regex re = new Regex(p, RegexOptions.IgnoreCase);
MatchCollection mc = re.Matches(all_code);
我这样用好像不能从all_code提取不到符合要求的字符串,是不是我用的不对?
[/Quote]
string p = @"(^S[0-9]{10}$)";
Regex re = new Regex(p, RegexOptions.IgnoreCase);
MatchCollection mc = re.Matches(all_code);
我这样用好像不能从all_code提取不到符合要求的字符串,是不是我用的不对?
[/Quote]
不要限定首尾,直接用 S[0-9]{10} 就可以提取到了