string s = "ssaabb";
            var old = Regex.Replace(s, @"([a-zA-Z])(?<p>\1){1,}", (p) => {
                return p.Groups["p"].Value;
            });

            Console.WriteLine("{0} => {1}",s,old);

  其中正则中的\1,是取得匹配结果分组1的字符,{1,}即重复1次以上。

相关文章:

  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2021-12-13
猜你喜欢
  • 2021-08-14
  • 2022-01-14
  • 2021-10-18
  • 2021-09-02
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案