This question is related to RegEx: Grabbing values between quotation marks
The RegEx from the best answer
(["'])(?:(?=(\\?))\2.)*?\1
tested with the
also matches strings that start with an escaped double quote. I tried to extend the definition to work with a negativ lookbehind.
(["'](?<!\\))(?:(?=(\\?))\2.)*?\1
but this does not change anything in the matched pattern. Any suggestions on how to exclude escaped singe / double quotes as a starting pattern?
I want to use this as a highlighting pattern in nedit, which supports regex-lookbehind.
example for desired matching:
<p>
<span style="color: #ff0000">"str1"</span> notstr
<span style="color: #ff0000">"str2"</span>
\"notstr <span style="color: #ff0000">"str4"</span>
</p>