W3C home > Mailing lists > Public > www-validator@w3.org > August 1999

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

From: Earl Hood <ehood@hydra.acs.uci.edu>
Date: Tue, 03 Aug 1999 00:30:18 -0700
Message-Id: <199908030730.AAA04391@medusa.acs.uci.edu>
To: Gerald Oskoboiny <gerald@w3.org>
cc: www-validator@w3.org
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:

    s/<!(?:--(?:[^-]|-[^-])*--\s*)+>//go;

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.

	--ewh
Received on Tuesday, 3 August 1999 03:30:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:52 GMT