[whatwg] pattern attribute

Super-User root at www3.itn.co.uk
Mon Aug 23 03:07:53 PDT 2004

>>>3. Finally, is it necessary to have an ERROR_ for invalid regexes
> Ian Hickson wrote:
> > No, if the regexp is invalid, it is just ignored.
> This is both a good thing and a bad thing. Ignoring the regexp makes 
> sense, but also makes debugging complex regexps a nightmare. Maybe 
> WHATWG should provide a reference implementation regexp checker and/or 
> debugger for these purposes?
> Thoughts?

I am inclined to agree. I can't see any benefit in silently failing an invalid
regex. I don't think you necessarily need a standard checker / debugger (just
a standard regex!) but you do need to know when a regex is invalid. After all,
this is likely to be a "development time" rather than a "run time" issue, as
it is not dependent on input, so there should be circumstances where throwing
an error is a bad thing.


More information about the whatwg mailing list