-
Notifications
You must be signed in to change notification settings - Fork 12
Bikeshed: flag + corresponding getter #14
Comments
Slight preference for (“Only” in English is w=“double u”. French w="double v", German w="veh". I might reserve w for whatever comes after v...) Idea for the getter: extCharClass (for “extended”) |
+1 on Should expressions be |
It should be
|
We don't need to do that necessarily;
Two flags makes it more explicit that this is BOTH a unicode regex AND one with nested string sets. |
It's more explicit, but it is superfluous. I think /u alone will fall to the wayside, and people will just find it an annoyance. "Oh, you forgot to use /uv — you just used /v and that doesn't work by itself." |
I also have a slight preference for just We can leave |
Any opinions on the corresponding getter name? Here’s an overview of the current ECMAScript RegExp flags & getters:
What would we do for assert(/…/v.uniSet);
// or…
assert(/…/v.unicodeSet); Now that I’ve written this down, I like |
uniset sounds good, or maybe even just sets |
One reason I kind of like two separate flags is because the new key can be named "stringSets" or similar, without needing to reference Unicode. But if we had one combined flag, we might just need to say "unicodeWithStringClasses". |
I really think of this as ES Unicode Regex v2; it encompasses and extends what was there before with the /u flag. |
Could we please discuss the name of the getter once more? On its own, I agree "unicodeSet" makes sense. However, it's the same as the closely related ICU class UnicodeSet which has been around for 25-some years and supports a pattern string syntax similar to regex character classes, including string literals and most Unicode properties, yet with a different syntax, especially compared to this new proposal for regex set operators and string literals. How about some of the other suggestions here? Or "setOps", "stringSet", "classStringOps", ...? Crazy idea: Could we change the "unicode" getter to return numeric value 2 instead of boolean false/true, when |
|
|
Pending the resolution of #23, I prefer |
I’d like to propose resolving this bikeshed with |
During yesterday’s weekly sync we decided to proceed with |
Extracting the discussion from #2 (comment), if we want to gate the new syntax/semantics behind a new flag, there are two questions:
v
(u
as written in classical Latin) orw
(double-u
).RegExp.prototype
be?uniSet
?Let the bikeshedding commence.
The text was updated successfully, but these errors were encountered: