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
Regexp in UTF-8 causes issues in Lint/OutOfRangeRegexRef #10552
Labels
Comments
koic
added a commit
to koic/rubocop-ast
that referenced
this issue
Apr 20, 2022
Resolves rubocop/rubocop#10552. This PR makes `RegexpNode` aware of fixed-encoding regopt.
Appendix /^(\d+)-(\S+)$/u =~ value
if Regexp.last_match(1) != target
# do something
end => OK |
koic
added a commit
to koic/rubocop-ast
that referenced
this issue
Aug 5, 2022
Resolves rubocop/rubocop#10552. This PR makes `RegexpNode` aware of fixed-encoding regopt.
Looks good :-) |
@marcandre I've opened rubocop/rubocop-ast#230 to resolve this issue. Can you review it? |
marcandre
pushed a commit
to rubocop/rubocop-ast
that referenced
this issue
Aug 7, 2022
Resolves rubocop/rubocop#10552. This PR makes `RegexpNode` aware of fixed-encoding regopt.
koic
added a commit
that referenced
this issue
Aug 8, 2022
Follow up rubocop/rubocop-ast#230 and fixes #10552. This commit fixes a false positive for `Lint/OutOfRangeRegexpRef` when using fixed-encoding regopt.
WJWH
pushed a commit
to WJWH/rubocop
that referenced
this issue
Aug 8, 2022
Follow up rubocop/rubocop-ast#230 and fixes rubocop#10552. This commit fixes a false positive for `Lint/OutOfRangeRegexpRef` when using fixed-encoding regopt.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
Lint/OutOfRangeRegexRef would not alert when using utf-8 encoding.
Actual behavior
Rubocop alerted when using encoding utf-8 (
/u
). But, Rubocop didn't alert when not using it.Steps to reproduce the problem
Given the code:
=> NG
=> OK
RuboCop version
Please tell me why they occur. Thank you!
The text was updated successfully, but these errors were encountered: