Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex literals with invalid \N{...} names should not compile #270

Open
natecook1000 opened this issue Apr 12, 2022 · 1 comment
Open

Regex literals with invalid \N{...} names should not compile #270

natecook1000 opened this issue Apr 12, 2022 · 1 comment

Comments

@natecook1000
Copy link
Member

UTS18 makes a distinction between providing an invalid name in a Unicode property character class (\p{name=...}) and an individual named character (\N{...}). If a programmer uses an invalid name in a property character class, the expression should compile and that character class should simply not match anything:

"🐯".contains(/\p{name=TIGER FACE}/)     // true
"🐯".contains(/\p{name=TIEGR FACE}/)     // false

However, an invalid name given in a \N{...} named character should be a syntax/compilation error:

"🐯".contains(/\N{TIEGR FACE}/)          // error: Invalid Unicode scalar name

See https://unicode.org/reports/tr18/#Individually_Named_Characters

@milseman
Copy link
Collaborator

milseman commented May 6, 2022

Update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants