#region 10_从不规则日期中提取年月日。
string xdate = "August 17 , 2016 ";
Match xMatch = Regex.Match(xdate, @"^([a-zA-Z]+)\s*(\d{1,2})\s*,\s*(\d{4})\s*$");
Console.WriteLine("提取内容如下:");
for (int i = 1; i < xMatch.Groups.Count; i++)
{
Console.WriteLine(xMatch.Groups[i]);
}
//Console.WriteLine(xMatch.Groups[1].Value);
//Console.WriteLine(xMatch.Groups[2].Value);
//Console.WriteLine(xMatch.Groups[3].Value);
Console.WriteLine("提取出的日期为:{0}-{1}-{2}",xMatch.Groups[3],xMatch.Groups[1],xMatch.Groups[2]);
Console.WriteLine("当前系统日期为:{0}",System.DateTime.Now);
Console.ReadKey();
#endregion