As of Firefox 115, we will support the /v flag ("Unicode Sets") in RegExps.
Use case:
This adds syntax and semantics for the following set operations:
difference/subtraction (in A but not in B)
intersection (in both A and B)
nested character classes (needed to enable the above)
along with some additional unicode properties.
An example from the proposal explainer, looking for “invisible characters”
except for ASCII space:
[[\p{Other}\p{Separator}\p{White_Space}\p{Default_Ignorable_Code_Point}]--\x20]
The /v flag advanced to Stage 4 at the May 2023 meeting of TC39 and will be
included in the next edition of the ES standard.
Bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1713657
Standard:
https://github.com/tc39/proposal-regexp-v-flag
Platform coverage:
All, no pref
DevTools bug:
N/A
Other browsers:
V8 shipping in 112 <https://bugs.chromium.org/p/v8/issues/detail?id=11935>
JSC shipping in Safari Technology Preview 166 <
https://bugs.webkit.org/show_bug.cgi?id=241593>
Testing:
There are test262 tests covering these features:
https://github.com/tc39/test262/tree/main/test/built-ins/RegExp/property-escapes/generated/strings
https://github.com/tc39/test262/tree/main/test/built-ins/RegExp/prototype/unicodeSets
https://github.com/tc39/test262/tree/main/test/built-ins/RegExp/unicodeSets/generated
Secure contexts:
This is a JS language feature and is therefore present in all contexts.
--
You received this message because you are subscribed to the Google Groups
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/CAC_Rxa7YLQks_8aZMh1tfcgK9nH6aKd-G%2BGrPBX-mQf7kVHtoA%40mail.gmail.com.