What’s the regex to match anything except a double quote not preceded by a backslash?

No lookbehind necessary:

"([^"]|\\")*"

So: match quotes, and inside them: every character except a quote ([^"]) or an escaped quote (\\"), arbitrarily many times (*).

Leave a Comment