【问题标题】:Regex error on special characters [duplicate]特殊字符的正则表达式错误[重复]
【发布时间】:2014-02-12 08:17:46
【问题描述】:

代码:

Regex rx = new Regex(@"A(\S");

foreach (Match match in rx.Matches(strinG))
{
  int ii = match.Index;
  Console.WriteLine(ii);
 }

在运行时出错,

system argument exception - " A(\S" not enough )' ".

谁能帮帮我,如何解决这个问题?

【问题讨论】:

    标签: c#


    【解决方案1】:

    我假设您正在搜索括号,然后反斜杠。

    Regex rx = new Regex(@"A\(\S");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-14
      • 2018-06-13
      • 2023-03-31
      相关资源
      最近更新 更多