- From: Maciej Stachowiak <mjs@apple.com>
- Date: Wed, 10 Nov 2010 09:34:41 -0800
- To: Ian Hickson <ian@hixie.ch>
- Cc: Jonas Sicking <jonas@sicking.cc>, HTML WG <public-html@w3.org>
On Nov 10, 2010, at 9:18 AM, Ian Hickson wrote: > On Wed, 10 Nov 2010, Jonas Sicking wrote: >>> >>> http://dev.w3.org/html5/status/issue-status.html#ISSUE-137 >> >> The editor was never given a chance to respond to the new information >> that was made available in the bug before this was turned into an issue. >> >> So given the fact that it's unlikely that the regexp won't be extended >> to deal with the use case, Ian, are you still opposed adding some >> attribute to allow case insensitive matching? > >> From a holistic point of view, I think the platform would be best served > by improving regular expression syntax throughout the platform rather than > having to update each place that uses regular expressions each time a new > feature is added. I also think it is too early to know how we should > improve pattern="" at this point, since it is not widely used. So on > balance I do not think it is a good idea for us to make the proposed > change at this point. Just as a technical point about ECMAScript regexps (with chair hat off): In ECMAScript, the regular expression syntax is split into two parts, pattern and flags. All ways of creating a regexp from a string allow passing both. The HTML5 pattern="" attribute only allows expressing the pattern, not the lags. So it's not consistent with the regexp system in the rest of the platform. Allowing the flags to be expressed (either with a separate attribute, or by allowing the full regexp literal syntax in the pattern attribute) would make HTML5 consistent with ECMAScript. It is currently not consistent. Allowing the pattern attribute to express the flags part of the regexp syntax would also guarantee all future ES regexp improvements carry over to HTML5, whether they are in the flags part or the pattern part of the syntax. Short version: ECMAScript has the capability to express a case-insensitive regexp already, but the pattern="" attribute does not gain that feature because it only allows one part of the two-part ECMAScript regexp syntax. In fairness, of the current three ECMAScript regexp flags, only two seem likely to have a useful effect on the pattern attribute, specifically the "m" and "i" flags, but not the "g" flag. Regards, Maciej
Received on Wednesday, 10 November 2010 17:35:16 UTC