tc39 / proposal-regexp-v-flag

UTS18 set notation in regular expressions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

allow escape for more characters in u not just v?

markusicu opened this issue · comments

In the TC39 meeting today (2021-may-26) @waldemarhorwat commented on our proposed new character class syntax allowing identity escapes of more symbol/punctuation characters than the existing syntax, and asked whether the existing Unicode/u syntax should be extended to allow identity escapes for the same larger set.

In the current version of the proposed spec changes, the additional characters allowed in identity escapes inside character classes are

ClassHalfOfDouble :: one of & - ! # % , : ; < = > @ _ ` ~

Seems like a good idea. Anyone opposed?

Also, in the existing Unicode mode, a dash can be escaped inside a character class but not outside. Might want to allow that everywhere.

Should these simply be added to CharacterEscape via IdentityEscape, allowing them even outside of character classes?

Should this be done as part of the spec changes for this proposal, or separately?

I like it!

Should this be done as part of the spec changes for this proposal, or separately?

IMHO it should be done separately, so that this proposal does not affect u semantics at all.

We just removed the _ from the set of characters to escape. See issue #60.

To clarify: This is an independent change for /u except for the desire to synchronize the set of characters that can be escaped.

This is still worth pursuing, but as discussed, is not part of this proposal.