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
was overzealous, and would cause new RegExp(escapeRegExp(input), "ug") to fail when the input string contained a -.
This probably has some intersection with discussions in other threads, e.g. if some delegates require that the result escape - so that it can work in situations like new RegExp("[" + RegExp.escape(input) + "]", "ug"), such a requirement prohibits the result from working in situations like new RegExp(RegExp.escape(input), "ug").
The text was updated successfully, but these errors were encountered:
Yeah, as I suggested in that thread, I think if we include - in this proposal we'd need to change u-mode regexes so that \- is treated an identity escape, i.e. it maps to - .
I recently enabled the ESLint rule which encourages always using the
u
flag. When doing so, I found out that my custom regexp escaper, which waswas overzealous, and would cause
new RegExp(escapeRegExp(input), "ug")
to fail when the input string contained a-
.This probably has some intersection with discussions in other threads, e.g. if some delegates require that the result escape
-
so that it can work in situations likenew RegExp("[" + RegExp.escape(input) + "]", "ug")
, such a requirement prohibits the result from working in situations likenew RegExp(RegExp.escape(input), "ug")
.The text was updated successfully, but these errors were encountered: