We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Per spec:
RegExpIdentifierStart [UnicodeMode] :: \ RegExpUnicodeEscapeSequence [+UnicodeMode]
The unicode escape sequence within a regexp identifier is always parsed with UnicodeMode, so /(?<\u{41}>)\k\u{41}/ should be valid.
UnicodeMode
/(?<\u{41}>)\k\u{41}/
Input (?<\u{41}>)\k<\u{41}>
(?<\u{41}>)\k<\u{41}>
It should parse
Include browser name and version Firefox 133.0a1 (2024-10-22) (aarch64)
Include OS name and version Darwin Kernel Version 23.6.0: Wed Jul 31 20:49:39 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered:
I've never seen this before, very interesting. Do you know when support for this syntax was introduced?
Sorry, something went wrong.
Good question. It seems that the always-UnicodeMode semantic was introduced in ES2020: https://tc39.es/ecma262/2020/#prod-RegExpIdentifierPart, specifically from this normative change: tc39/ecma262#1869
Previously in ES2019, https://tc39.es/ecma262/2019/#prod-RegExpIdentifierPart, the UnicodeMode was inherited from the context.
No branches or pull requests
Bug Description
Per spec:
The unicode escape sequence within a regexp identifier is always parsed with
UnicodeMode
, so/(?<\u{41}>)\k\u{41}/
should be valid.Reproduction steps
Input
(?<\u{41}>)\k<\u{41}>
Expected Outcome
It should parse
Browser
Include browser name and version
Firefox 133.0a1 (2024-10-22) (aarch64)
OS
Include OS name and version
Darwin Kernel Version 23.6.0: Wed Jul 31 20:49:39 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered: