Closed pgilad closed 7 years ago
Interesting suggestion. Would you need this flag if you use a Unicode RegExp?
I strongly disagree with this suggestion. Introducing new flags has a cost, and should only be done when absolutely necessary. RegExps with the u
flag set can be extended with new syntax in a backwards compatible way already, so no new flag is needed.
instead of allowing them only in unicode regex
Why would you not want to use the u
flag for new regular expressions?
I suggested it because according to author this cannot be used safely (without breaking backwards compat.) with non-unicode regexp, but if everyone intends to use the u
flag then another new flag is redundant
I don't think we'll use a new flag; we'll probably use one of the options described at https://github.com/tc39/proposal-regexp-named-groups/issues/7
instead of allowing them only in unicode regex, and to ensure backwards compatibility, the named capture groups can be turned on via a new RegExp flag
Maybe
/k
?