相关疑难解决方法(0)

使用正则表达式在C#中使用转义引号查找带引号的字符串

我试图在一行中找到所有引用的文本.

例:

"Some Text"
"Some more Text"
"Even more text about \"this text\""
Run Code Online (Sandbox Code Playgroud)

我需要得到:

  • "Some Text"
  • "Some more Text"
  • "Even more text about \"this text\""

\"[^\"\r]*\" 除了最后一个之外,它给了我所有的东西,因为有报道.

我已阅读有关\"[^\"\\]*(?:\\.[^\"\\]*)*\"工作的信息,但在运行时遇到错误:

parsing ""[^"\]*(?:\.[^"\]*)*"" - Unterminated [] set.
Run Code Online (Sandbox Code Playgroud)

我该如何解决?

c# regex quotes escaping

40
推荐指数
2
解决办法
5万
查看次数

标签 统计

c# ×1

escaping ×1

quotes ×1

regex ×1