Find comment lines and delete them

Find, replace, find in files, replace in files, regular expressions

Find comment lines and delete them

Postby rob-nidan » Mon Jan 03, 2005 3:05 pm

Hi,

I am trying to find/replace comments notes in files. I have read all forum to help me out, but I was able to achieve it. Can you help.

Here the lines that I want to find/replace with blank space:

<!-- comments for the files --> the comments are not all the same but start always with the same key words.

I tried the following:

^{<!--[0-9, a-z]^}^$

Regards
User avatar
rob-nidan
Newbie
 
Posts: 1
Joined: Mon Jan 03, 2005 12:00 am

Re: Find comment lines and delete them

Postby Mofi » Thu Jan 06, 2005 9:56 am

The following expresions are all in UltraEdit style. Read help of UltraEdit about regular expression for details.

To delete everything after <!-- in the same line use <!--*$.

To delete only everything between <!-- and --> in the same line use <!--*-->.

And finally to delete everything between <!-- and --> also over multiply lines use <!--[~!]+-->.

Choose the one best for your files.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Find/Replace/Regular Expressions