string xxx = "......."; string pat = "{\"userid\":[^}.]*?}"; //校验段 MatchCollection mc = new Regex (pat, RegexOptions.Multiline).Matches (xxx); //去除多行,返回校验集合 foreach (Match m in mc) { print(m.Value); }