string str = @"1 a b c
>> c
>> n
2 q c n
>> z
3 p o p
>> n i u
>> v ";
Regex reg = new Regex(@"^(\d.*?)$",RegexOptions.Multiline);//如果开头有空格,就改成(@"^\s*(\d.*?)$
MatchCollection mc = reg.Matches(str);
foreach (Match m in mc)
{
Console.WriteLine(m.Groups[1].Value);
}Console.Read();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货