日期:2014-05-18 浏览次数:20966 次
string source = @"1 2012.05 10000000000 ; 2 2012.05 10000000000 ; 3 2012.06 10000000000";
Regex reg = new Regex(@"\d+\u0020(?<year>[\d]{4}).(?<month>[\d]{2})\u0020(?<phone>\d+)");
MatchCollection mc = reg.Matches(source);
foreach (Match m in mc)
{
//这里解析除了年月和电话,自己写到文件吧
MessageBox.Show(m.Groups["year"].Value);
MessageBox.Show(m.Groups["month"].Value);
MessageBox.Show(m.Groups["phone"].Value);
}