This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26915 - Opt-in to the ES6 `u` flag for regular expressions?
Summary: Opt-in to the ES6 `u` flag for regular expressions?
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/#the-pat...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-27 10:08 UTC by contributor
Modified: 2014-10-10 20:38 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2014-09-27 10:08:48 UTC
Specification: https://html.spec.whatwg.org/multipage/forms.html
Multipage: https://html.spec.whatwg.org/multipage/#the-pattern-attribute
Complete: https://html.spec.whatwg.org/#the-pattern-attribute
Referrer: https://www.google.com/

Comment:
Opt-in to the ES6 `u` flag for regular expressions?

Posted from: 176.219.173.4
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.58 Safari/537.36 OPR/25.0.1614.18 (Edition beta)
Comment 1 Mathias Bynens 2014-09-27 10:11:52 UTC
ES6 introduces the `u` flag for regular expressions, which makes their behavior much more sensible and Unicode-friendly. It would be nice to enable this flag for the `pattern` attribute. Backwards compatibility is a concern (I’ve documented some differences in behavior here: https://mathiasbynens.be/notes/es6-unicode-regex) so we might need a new opt-in switch.
Comment 2 Ian 'Hixie' Hickson 2014-09-29 16:36:20 UTC
Isn't there an inline opt-in like in Perl? (e.g. so you can have subregions that are case-insensitive and subregions that aren't?)
Comment 3 Simon Pieters 2014-09-29 20:41:19 UTC
Use counter for pattern:
http://www.chromestatus.com/metrics/feature/timeline/popularity/44

Earlier discussion about `i`:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=11011
Comment 4 Ian 'Hixie' Hickson 2014-10-10 20:38:40 UTC
I think if we have to have an out-of-band opt-in, this is a non-starter. However, if we can just turn this on always, it would make a lot of sense.

I've gone ahead and made "u" be specified always. Hopefully this is Web-compatible. The biggest risk is with inappropriate escapes (as in pattern="\a").