Contact emails
yan...@chromium.org, mat...@chromium.org
Spec
https://github.com/tc39/proposal-regexp-unicode-property-escapes (stage 3 proposal)
Summary
The Unicode Standard assigns various properties and property values to every symbol. For example, to get the set of symbols that are used exclusively in the Greek script, search the Unicode database for symbols whose Script property is set to Greek.
Unicode property escapes are a new type of escape sequence available in regular expressions that have the u flag set. They enable querying the Unicode database for certain properties and values.
E.g. /\p{Script=Greek}/u.test('π') === true
Link to “Intent to Implement” blink-dev discussion
There was none.
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
Demo link
None. The explainer in the proposal offers some examples.
Interoperability and Compatibility Risk
In regular expressions without the u flag, the pattern \p is an (unnecessary) escape sequence for p. Patterns of the form \p{Letter} might already be present in existing regular expressions without the u flag, and therefore we cannot assign new meaning to such patterns without breaking backwards compatibility.
For this reason, ECMAScript 2015 made unnecessary escape sequences like \p and \P throw an exception when the u flag is set. This enables us to change the meaning of \p{…} and \P{…} in regular expressions with the u flag without breaking backwards compatibility.
Edge/Chakra: public support; tracking issue: https://github.com/Microsoft/ChakraCore/issues/2969
Firefox/SpiderMonkey: public support; tracking issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1361876
Safari/JavaScriptCore: shipped in Safari Technical Preview 42; tracking issue: https://bugs.webkit.org/show_bug.cgi?id=172069
Web developers: positive signals
Is this feature fully tested?
Yes. In addition to V8’s own tests (v8/test/mjsunit/harmony/regexp-property-*.js), Test262 includes tests for this feature.
OWP launch tracking bug
https://bugs.chromium.org/p/v8/issues/detail?id=4743
Entry on the feature dashboard
https://www.chromestatus.com/features/6706900393525248
Note that since this is a V8/JS feature, this post is just an FYI to blink-dev — no signoff from Blink API owners is required.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADizRgbnTY1wLi6ZrF4_w74-PyZSgZgUruJrP4Q6-O1i5t6aMg%40mail.gmail.com.--
You received this message because you are subscribed to the Google Groups "blink-dev" group.