Erik Corry wrote:
Steven Levithan wrote:
- Make \d\w\b Unicode-aware.
I think we should leave these alone. They are concise and useful and
will continue to be so when /u is the default in Harmony code.
Instead we should introduce \p{...} immediately which provides the
same functionality.
\w and \b are broken without Unicode. ASCII \d is concise and useful, but so
is [0-9]. Unicode-aware \b can't be emulated using \p{..} unless lookbehind
is also added (which is tentatively approved for ES6 but could get delayed).
Unicode-aware \w\b\d are required by UTS#18. If \w\b\d are not made
Unicode-aware by /u, we won't easily be able to fix them in the future.
We went down this road before, and at the end you agreed that \w\b\d with /u
should be Unicode aware. :/
I agree with adding \p{..} as soon as possible, with two caveats:
* If I recall correctly, mobile browser implementers voiced concerns about
overhead during the es4-discuss days.
* It can easily be pushed down the road to ES7+.
Delaying /u, on the other hand, might mean also having to delay Norbert's
work on code point matching, etc. Introducing \p{..} without code point
matching would be nonideal. \p{..} might *need* to be delayed anyway to
allow RegExp proposals already approved by TC39 (match web reality,
lookbehind, flag /y), the flag /x strawman, and flag /u to be completed in
time. For starters, it's not clear which properties \p{..} in ES would
support, and there would be a number of other details to discuss, too.
Erik Corry wrote:
Make unpaired surrogates in /u regexps a syntax error.
Sounds good to me.
-- Steven Levithan
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss