in reply to Removing html comments with regex

In addition to the above cautions, a simple regex may also delete some Server Side Include commands since they look a lot like comments.

<!--#include virtual="/ssi/navbarB.ssi" --> <!--#echo var="SERVER_NAME" --> <!--#echo var="Document_URI" --> <!--#config timefmt="%Y/%m/%d at %H:%M:%S %Z" --> <!--#echo var="LAST_MODIFIED" -->

-ted-

Replies are listed 'Best First'.
Re: Removing html comments with regex
by Abigail-II (Bishop) on Aug 23, 2003 at 23:09 UTC
    If that appears in an HTML document, they not only look like comments, they are HTML comments.

    Abigail

      If SSI commands appear in the html sent to the browser, then something went wrong at the server. So you're right from the browsers point of view - they are comments. But if he is working with source html, on the server, he could run into that situation.

      -ted-