Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 特殊字符上的正则表达式错误_C# - Fatal编程技术网

C# 特殊字符上的正则表达式错误

C# 特殊字符上的正则表达式错误,c#,C#,代码: 在运行时出现错误 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 )' ". 我假设您正在搜索括号,然后将其反斜杠 syst

代码:

在运行时出现错误

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 )' ".

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

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