I'm having trouble coming up with the regex I need to do this find/replace in Notepad++. I would like to find/replace specific character in strings between two words
for example
msgid "flower"
"test hold"
msgstr
I would like to find multiple o
character between msgid "
and msgstr
and replace with a
character. The result is
msgid "flawer"
"test hald"
msgstr
This looks very convoluted but should work for all cases:
((?:^.*?msgid "|\G)(?:(?!msgstr)[\s\S])*?)o(?=(?:(?!msgid ")[\s\S])*?msgstr)
Replace with
$1a
See test cases here
Basically what it does is to match o
s after seeing msgid "
, after that get the end of previous match using \G
and continue matching the rest of o
s before encountering msgstr
.