Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.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# 在VisualStudio代码中使用(?s)正则表达式选项_C#_Regex_Visual Studio Code - Fatal编程技术网

C# 在VisualStudio代码中使用(?s)正则表达式选项

C# 在VisualStudio代码中使用(?s)正则表达式选项,c#,regex,visual-studio-code,C#,Regex,Visual Studio Code,我习惯于编写支持多个选项的reular表达式,以指定区分大小写、忽略空白、表示等。。。在C#中,这些选项分别用(?i)、(?x)和(?s)指定 这些修饰符如何与Visual Studio代码查找功能一起使用我收到一个错误:无效正则表达式:无效组。 示例: q.*?abc.*?q 将匹配heheabchihi,但不匹配 <q>hehe abchihi</q> 呵呵 阿卜希希 由于与所有字符不匹配(\n被省略)。添加(?s)可以修复C#regex中的问题,但不能在

我习惯于编写支持多个选项的reular表达式,以指定区分大小写、忽略空白、表示
等。。。在C#中,这些选项分别用
(?i)、(?x)和(?s)
指定

这些修饰符如何与Visual Studio代码查找功能一起使用<代码>我收到一个错误:无效正则表达式:无效组。

示例

q.*?abc.*?q 
将匹配
heheabchihi
,但不匹配

<q>hehe
  abchihi</q>
呵呵
阿卜希希

由于
与所有字符不匹配(
\n
被省略)。添加
(?s)
可以修复C#regex中的问题,但不能在Visual Studio代码中解决。Visual Studio代码使用正则表达式选项的方式是什么?

向我们展示您遇到问题的正则表达式您可以给出一个例子吗?添加了一个例子。我不太使用VSCode,但是。向我们展示您遇到问题的正则表达式您可以给出一个例子吗?添加了一个例子。我不太使用VSCode,但是。