正则表达式获取 "2007-08-30 12:30 "其中的每个时间 "2007 " "08 " "30 " "12 " "30 "
------解决方案--------------------------------------------------------
给个用正则的理由先
DateTime dt = DateTime.Parse( "2007-08-30 12:30 ");
string year = dt.ToString( "yyyy ");
string month = dt.ToString( "MM ");
其它类同,分别为dd、HH、mm
------解决方案--------------------------------------------------------
如果用正则提取,可以这样
^(? <year> \d{4})-(? <month> \d{2})-(? <day> \d{2})\s+(? <hour> \d{2}):(? <minute> \d{2})$