Reputation: 13
Need to replace/remove multiple occurrences in notepad++ using regex. Here is an example:
....
something<item>text to be removed or replaced</item>
text<item>another text to be
removed or replaced</item>
<item>more text to be removed or
replaced</item>
...
I need to replace/remove everything in between "<item>"
and "</item>"
, matches could include a new line.
So I would end up with something like this:
....
something<item></item>
text<item></item>
<item></item>
...
Upvotes: 0
Views: 2046
Reputation: 2300
One way to do this find/replace:
Find what: (<item>).*?(<\/item>)\R?
Replace with: $1$2
Check the Matches new line
checkbox.
More information: Notepad++ User Manual - Regular Expressions
Upvotes: 5