We are going to use NotePad++ replace functionality (CTRL+H) to remove all multi-line comments that are enclosed in a pair of /* and */.
While in the source file you want to edit, open up the ‘Replace’ window either from the ‘Search’ menu or by using CTRL+H.
Set ‘Search Mode’ to ‘Regular expression’ and tick the ‘. matches newline’.
In the ‘Find what:’ input type /\*(.*?)\*/\n
and leave the ‘Replace with:’ input empty.
To find the next comment, you can click the ‘Find Next’ button and then hit ‘Replace’.
To make the change on all comments just hit ‘Replace All’.
This post is also available in: Greek
Thank you for this. Works like a charm if you read carefully “tick match new line”. 😉
How one can delete multiple lines by defining the start and end line numbers ?
Using Notepad++ you can select a range of lines and delete them following the procedure below:
Press
Ctrl + G
, type the start line and hitEnter
to go to the start line.Then go to the menu, click on
Edit
and thenBegin/End select
.Press again
Ctrl + G
, and type the end line number and hitEnter
to go to it.Back to the menu, click on
Edit
and thenBegin/End select
once more.By now you will have your range of lines to be deleted selected so just press
Backspace
orDelete
.Pingback: Homepage