You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TS1508: Unexpected '?'. Did you mean to escape it with backslash? shouldn't report even with v flag #62707
A strange thing about this error is that it mentions ? but it is really about & (that's where the error squiggly is). If you escape the ? the error persists, and only goes away if you escape the &. Indeed it looks like the error talks about the first character (e.g., if you write /[\?&]/v to "fix" the error, the error stays but now it says "unexpected \"). So whether or not there's a bug around requiring & to be escaped (I think only && needs to be escaped, right?) there does seem to be a bug around the text of the message... so this is... two bug reports? Should we file another one (if neither are duplicates)?
A strange thing about this error is that it mentions ? but it is really about & (that's where the error squiggly is). If you escape the ? the error persists, and only goes away if you escape the &. Indeed it looks like the error talks about the first character (e.g., if you write /[\?&]/v to "fix" the error, the error stays but now it says "unexpected \"). So whether or not there's a bug around requiring & to be escaped (I think only && needs to be escaped, right?)
Right. /[?&&]/v gives an error in Chrome, for example, while /[?&]/v does not.
Activity
jcalz commentedon Nov 2, 2025
No, it was present in 5.6.3. Maybe you should edit it to "This changed in #55600 which introduced regular expression syntax checking"
A strange thing about this error is that it mentions
?but it is really about&(that's where the error squiggly is). If you escape the?the error persists, and only goes away if you escape the&. Indeed it looks like the error talks about the first character (e.g., if you write/[\?&]/vto "fix" the error, the error stays but now it says "unexpected\"). So whether or not there's a bug around requiring&to be escaped (I think only&&needs to be escaped, right?) there does seem to be a bug around the text of the message... so this is... two bug reports? Should we file another one (if neither are duplicates)?brettz9 commentedon Nov 2, 2025
I did check, but must have messed it up. Thanks!
Right.
/[?&&]/vgives an error in Chrome, for example, while/[?&]/vdoes not.RyanCavanaugh commentedon Nov 3, 2025
Paging graphemecluster (@graphemecluster)
Andarist commentedon Nov 3, 2025
The incorrectly reported character gets fixed by this patch:
But the other part of the issue would have to be investigated further.
graphemecluster commentedon Nov 4, 2025
These 3 lines shouldn't have been there in the first place 😄
Remove a mistaken error in `scanClassSetExpression` (microsoft/TypeSc…
Ijtihed commentedon Jun 5, 2026
I fixed lone
&handling in/vcharacter classes and added a compiler regression test for it asw.