Re: WWW-Validator Bug (response to private mail on other topic)

From: Earl Hood (
Date: Tue, Aug 03 1999

Message-Id: <>
To: Gerald Oskoboiny <>
Date: Tue, 03 Aug 1999 00:30:18 -0700
From: Earl Hood <>
Subject: Re: WWW-Validator Bug (response to private mail on other topic) 

On August 2, 1999 at 23:35, Gerald Oskoboiny wrote:

> > If the data is passed in as a single string, a comment
> > stripping regex:
> > 
> > 	s/<!--([^-]|-[^-])*--\s*>//go;
> > 
> > Could first be applied before checking for a doctype declaration.
> Thanks for the regex; I added it in the doctype-checking
> function. Unfortunately this still won't handle multi-line
> comments, so I need to figure out what to do about those.

As pointed out later in discussion, the regex above is not
completely accurate.  Use:


The first one I gave does not handle multiple "-- --" occurances.

As for multi-line use, you could do a join on the passed in
array to get a single string, and then have a go at it.

Even better, when you get the document data, keep it in
a scalar instead of an array.  Only do a split on the scalar
to get the individual lines for error reporting.