I need a regex that captures between double quotes (and single quotes, but for the sake of simplicity we'll ignore that) over multiple lines. The problem is that there might be escaped double quotes (\"
) in there too, which would stop the regex from searching in all of my attempts.
So here's an example: He said: "This is my \"example\" string" and ran off
The regex should match: This is my \"example\" string"
My current regex (/(["\'])(.*?)\1/
) does match "This is my \"
and " string"
and which also doesn't work over multiple lines.
source https://stackoverflow.com/questions/77608082/regex-that-captures-between-double-quotes-over-multiple-lines-ignoring-escaped-d
No comments:
Post a Comment