中文:/[\u4e00-\u9fa5]/

日文:/[\u0800-\u4e00]/

韩文:/[\uac00-\ud7ff]/

C# 正则表达式应用实例

 Regex regWord = new Regex(
                  "[\u4e00-\u9fa5\u0800-\u4e00\uac00-\ud7ff]",
                  RegexOptions.IgnoreCase
                  | RegexOptions.CultureInvariant
                  | RegexOptions.IgnorePatternWhitespace
                  | RegexOptions.Compiled
                  );
            int intWord = 0;       
            intWord = regWord.Matches(text).Count;
   

相关文章:

  • 2021-11-27
  • 2021-11-24
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
  • 2021-11-17
  • 2022-01-08
  • 2022-01-08
猜你喜欢
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
  • 2021-11-27
  • 2022-01-08
  • 2022-12-23
相关资源
相似解决方案