日期:2014-05-17 浏览次数:20810 次
string sourcestr = @"Variables = ""x1"",""x2"",""v1"",""v2"",""type"" ZONE T="" Time = 1.8000E-05 "" F=FEPOINT";
Regex regstr = new Regex(@"(?i)Variables\s*=\s*(?<id1>.*?)\s*,\s*""type""\s*ZONE\s*T\s*=\s*(?<id2>.*?)\s*F\s*=\s*(?<id3>.*?)(?=$)");
Console.WriteLine(regstr.Match(sourcestr).Groups["id1"].Value);
Console.WriteLine(regstr.Match(sourcestr).Groups["id2"].Value);
Console.WriteLine(regstr.Match(sourcestr).Groups["id3"].Value);