March 22nd, 2008

Regular Expression to find comments in HTML source code

The below mentioned regex or regular expression can be used to find all the comments lines in HTML source code

\< ![^\>]#\>

If you want to clean up your html from comments than you can use the search and replace feature of variuos text editors that understand regex ( ultraedit recommened) and replace this regex string with an empty one

You can even use this regex in MS Frontpage to remove the commented text

the imax | 6:59 am | Uncategorized

This entry was posted on Saturday, March 22nd, 2008 at 6:59 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Regular Expression to find comments in HTML source code”

Leave a Reply