-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Whitespace in character classes is mentioned in the proposal, but how should flag x handle whitespace in other enclosed tokens: {…}, \p{…}, \P{…}, \u{…}, [\q{…}], (?<…>), \k<…>.
Prior art is generally the following:
- Whitespace in an interval quantifier (
{ …},{… ,}, etc.) leads to{matching a literal{. Presumably this wouldn't be the case in ECMAScript with flaguorv, and I'm assuming whitespace with flagxwould not be allowed. \p{…}and\P{…}allow insignificant whitespace (per Unicode recommendations) even without flagx. Not so in ECMAScript, which is stricter, and I'm assuming this would not be relaxed with flagx.\u{…}is not common in other regex flavors, but some have equivalent\x{…}, and I believe they make it an error to add whitespace even with flagx.[\q{…}]is unique to ECMAScript AFAIK, but I assume it would allow insignificant whitespace with flagx.(?<…>)and\k<…>do not allow whitespace, even with flagx.
I'm assuming things like \u {…}, ( ?:…) and (? :…) would be errors even with flag x, and that \0 0 would be equivalent to \0(?:)0.
Metadata
Metadata
Assignees
Labels
No labels