日期:2014-05-17 浏览次数:20879 次
string s = @"[DataClassData] DataClassPath=cc DataClass=bb [DataClassSettings] DataClassPath=aa DataClass=bb [DataClassData] DataClassPath=dd DataClass=bb"; Match match = Regex.Match(s, @"(?is)\[DataClassSettings\]\s*.*?(DataClassPath=[^\r\n]+)"); Console.Write(match.Groups[1].Value);