Reputation: 107
I have string like:
/* Remove */
"REMOVE" = "Löschen \
";
And I have regular expression to match strings between " " = " "
"(\S+)"\s*=\s*"(.*?[\w\r\n]).*?";
What I have to add to match if string have more newlines in it, eg:
/* Remove */
"REMOVE" = "Lös \
ch \
en \
";
Upvotes: 1
Views: 7192
Reputation: 785156
You can use this regex:
"(\S+)"\s*=\s*"([^"]*)";
[^"]*
is negation pattern that will match any character (including newline) except a double quote.
Upvotes: 1
Reputation: 107287
You can just use (.*?)
and a dotall flag with which makes the dot match newline characters too :
(?s)"(\S+)"\s*=\s*"(.*?)"
See demo https://regex101.com/r/vM3tG6/2
Upvotes: 2