比较下面的两句:
System.Text.RegularExpressions.Regex.IsMatch("2.4.30",@"(^2\.4\.30$)|(^2\.4\.30$)")); //正确
System.Text.RegularExpressions.Regex.IsMatch("2.4.30",@"(^2\.4\.30$) | (^6\.5\.32$)"));//错误

第一句能达到企图,但是第二句却不行,返回false。原因就是|两边加了空格。
(我在the Regulator中这两个串都可以验证)

相关文章:

  • 2021-09-21
猜你喜欢
  • 2022-12-23
  • 2022-01-16
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案