标签: regex
我想匹配随机文本中的字符串
"quoted text"
"valid \" escaped quote"
"balanced \\\" quotes"
但不是字符串
"\\\"
"text"with quote"
正则表达式demo
正确答案
^"([^"\\]*(?:\\.[^"\\]*)*)"$
感谢参考!