This is my text
BROKEN This is a "sentence".
This sentence is an actual normal sentence.
I wish to replace/filter the quotation marks out of every line that has the word BROKEN in it I thought this would be simple but I couldn't do it my regex
(?=BROKEN)"
could I get some help?
If you also want to match double quotes before the word BROKEN
, you can skip the whole line that does not contain the word.
Find what:
^(?!.*\bBROKEN\b).*\R?(*SKIP)(*F)|"
Replace with: (leave empty)
Explanation
^
Start of string(?!.*\bBROKEN\b)
Negative lookahead, assert that the word BROKEN
does not occur.*\R?(*SKIP)(*F)
Match the whole line including an optional newline and skip the match|
Or"
Match a double quoteSee a regex101 demo.
Before
After