Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.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#_Regex - Fatal编程技术网

C# 正则表达式:(双)带引号的字符串

C# 正则表达式:(双)带引号的字符串,c#,regex,C#,Regex,我正在使用c#RegEx搜索脚本文本中引用的字符串。 我使用这个表达式:newregex(“\”(((?:\\.[^\\\\”]*)*)\”), e、 g“(((?:\\.\.[^\\\”]*)*)” 不处理\“案例的含义 这使得RegEx.Matches对于某些输入字符串运行并且从不停止 不要介意.Net正则表达式的这个问题,我知道我的表达式不是最好的 以前,我使用了(?表达式,但它对于“\\”输入字符串是不够的 目的是在分析脚本代码之前检测带引号的字符串 有人会建议一个好的表达方式吗 它必须

我正在使用c#RegEx搜索脚本文本中引用的字符串。 我使用这个表达式:
newregex(“\”(((?:\\.[^\\\\”]*)*)\”)
, e、 g
“(((?:\\.\.[^\\\”]*)*)”
不处理
\“
案例的含义

这使得
RegEx.Matches对于某些输入字符串运行并且从不停止

不要介意.Net正则表达式的这个问题,我知道我的表达式不是最好的

以前,我使用了
(?表达式,但它对于
“\\”
输入字符串是不够的

目的是在分析脚本代码之前检测带引号的字符串

有人会建议一个好的表达方式吗

它必须致力于:

echo("Hello" + yourName + ", here is \"MyTest\"");
path = "\\" + file;
echo("path ends with \\");
(使用此网站编辑的内容很奇怪)


非常感谢。

通常使用

"((?:[^\\"]|\\.)*)"

请参见。

您能将正则表达式放在自己的行中,并在前面加上四个前导空格吗?否则,没有人能理解您实际上想说什么。经过测试,您的表达式与我问题中给定的代码不匹配。