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 }}
This repository was archived by the owner on Aug 26, 2020. It is now read-only.
That code will replace any \w it finds with [a-zA-Z], unless the \w is preceded by another backslash - as in \\w - in which case it won't do the replacement as this is equivalent to a literal backslash followed by a literal "w". However, this code fails to do the replacement for \\\w which is a literal backslash followed by the \w character class and should be translated into \\[a-zA-Z].
Yep... this is similar to #4 in that the only solution is to actually parse the regex and operate on that, rather than the text.
It's definitely possible, but not likely to happen given that the jsonschema standard doesn't appear to really care about regex compatibility - I'd rather build a linter for incompatible syntax than a (much more difficult) translator.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The character class
\w
is replaced with[a-zA-Z]
to restrict matches to ASCII. The code that does that replacement is:js-regex/src/js_regex/_impl.py
Line 64 in 81478d2
That code will replace any
\w
it finds with[a-zA-Z]
, unless the\w
is preceded by another backslash - as in\\w
- in which case it won't do the replacement as this is equivalent to a literal backslash followed by a literal "w". However, this code fails to do the replacement for\\\w
which is a literal backslash followed by the\w
character class and should be translated into\\[a-zA-Z]
.Example:
The text was updated successfully, but these errors were encountered: