in reply to Re: HTML stripper...
in thread HTML stripper...
It's invalid because there's no space before -->That's bogus. There's no need for space to be there. Nor does there have to be space as the first character following a COM sequence (COM being --).
OTOH, your pattern falsely considers <!-- -- --> to be a valid comment, while it doesn't consider <!-- <!-- --> --> to be valid.
This matches HTML comments:
although if you are truely pedantic, you'd replace the \s with the set of characters the HTML DTD defines as white space characters.<!(?:--(?:[^-]*(?:-[^-]+)*)--\s*)*>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: HTML stripper...
by kcott (Archbishop) on Nov 22, 2010 at 23:57 UTC | |
by JavaFan (Canon) on Nov 23, 2010 at 00:36 UTC |