-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
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
Non-range-forming "-"s not correctly handled for character groups for JavaScript #5
Comments
The correct way to signify that the special char
https://foo123.github.io/examples/regex-analyzer/#action=analyze®ex=%2F%5Ba%5C-%5D%2F |
@foo123 Most real world JavaScript engines interpret For example, AdguardTeam/AdguardFilters#134630 |
Maybe be true, but it is still not correct. The |
Anyway in next update I will give it a closer look. Thanks |
According to the spec of ECMAScript, leading and trailing hyphen in a character class should be treated as a literal |
Additionally, a hyphen aaround a character group should be treated as literal. For example, Also a range involving a special char is not handled correctly, e.g. Added related examples in the OP. |
Updated lib to 1.2.0 (js only). This feature has been added. https://foo123.github.io/examples/regex-analyzer/#action=analyze®ex=%2F%5B-a%5D%2F |
@foo123 |
new upload of 1.2.0
Fixed
Done |
Example 1 (trailing
-
)Code:
Actual:
Expected:
Example 2 (prefixing
-
)Code:
Actual:
Expected:
Example 3 (prefixing
-
with negativity)Code:
Actual:
Expected:
Example 4 (
-
around a character group)Code:
Actual:
Expected:
Example 5 (
-
around a special char)Code:
Actual:
Expected:
The text was updated successfully, but these errors were encountered: