W3C home > Mailing lists > Public > w3c-sgml-wg@w3.org > January 1997

Re: Production 21 (and others)

From: <lee@sq.com>
Date: Wed, 29 Jan 97 22:33:36 EST
Message-Id: <9701300333.AA08599@sqrex.sq.com>
To: w3c-sgml-wg@www10.w3.org
Quoth Gavin:
>    "<!--*"([^*]|("*"[^-])|("*-"[^-])|("*--"[^>]))*"*-->" 

But I think there is a flaw, as this will not match
<!--**-*-->
as it's interpreted as folows:

>    "<!--*"([^*]|("*"[^-])|("*-"[^-])|("*--"[^>]))*"*-->" 
      A      B     C         D         E              F

<!--**-*-->
AAAAADDDBBB

This isn't actually a good thing to try to do with a regular expression.

For what it's worth, I tested this with perl (OK, so I'm dirty, but I'm
barefooted too, so that's OK):

perl -n -e 'if (/<!--\*([^*]|(\*[^-])|(\*-[^-])|(\*--[^>]))*\*-->/) { print; }'

Lee
Received on Wednesday, 29 January 1997 22:34:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:25:07 UTC