In other words, I have a string like:
“anything, escaped double-quotes: \”, yep” anything here NOT to be matched.
How do I match everything inside the quotes?
I’m thinking
^"((?<!\\)[^"]+)"
But my head spins, should that be a positive or a negative lookbehind? Or does it work at all?
How do I match any characters except a double-quote NOT preceded by a backslash?
No lookbehind necessary:
So: match quotes, and inside them: either an escaped quote (
\\") or any character except a quote ([^"]), arbitrarily many times (*).