日期:2014-05-18 浏览次数:20862 次
string source = "2012年6月";
Regex reg = new Regex(@"(?<year>\d{4}).*(?<month>\d{1,2}).*");
Match mm = reg.Match(source);
MessageBox.Show(mm.Groups["year"].Value);
MessageBox.Show(mm.Groups["month"].Value);
------解决方案--------------------