0

I have an XML file saved in Notepad++ and I want to delete multi-line comments (from <!-- through -->).  How can I do this globally (without going line by line)?  For example,

<Text>
<Text1>Hello</Text1>
<Text>
<!--<Text1>Hello</Text1> commented section
<Text> commented section
<Text1>Hello</Text1>--> commented section
<Text>
<Text1>Hello</Text1>
John
  • 1
  • 2
  • Do you just want to uncomment all multiline comments only, leaving normal comments? – silico-biomancer Feb 13 '19 at 21:45
  • 1
    Please read [How to use regular expressions in Notepad++ (tutorial)](http://docs.notepad-plus-plus.org/index.php/Regular_Expressions) and [Notepad++: A guide to using regular expressions and extended search mode](http://markantoniou.blogspot.co.uk/2008/06/notepad-how-to-use-regular-expressions.html). [Edit] your question when you get stuck after you have tried something yourself. – DavidPostill Feb 13 '19 at 21:45
  • I want to delete all multi line comments – John Feb 13 '19 at 22:23

2 Answers2

0

According to this answer notepad++ doesn't have this functionality with XML. Possibly use another editor that does, just to perform that function.

I'd suggest vim with the tcomment plugin, but I presume you're unfamiliar with vim so that may be tricky to use. VSCode may be more intuitive for you.

silico-biomancer
  • 448
  • 3
  • 11
0

Use replace with this regular expression:

<!--.+-->

and an empty replacement value. Check ". matches newline"

Maxence
  • 151
  • 3