问题
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>
...
回答1:
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
来源:https://stackoverflow.com/questions/35261772/regex-find-replace-in-notepad-including-new-lines