Skip to content
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

fixed_regex_linter() fails with "unrecognized escape" error #1845

Closed
IndrajeetPatil opened this issue Dec 13, 2022 · 1 comment · Fixed by #1846
Closed

fixed_regex_linter() fails with "unrecognized escape" error #1845

IndrajeetPatil opened this issue Dec 13, 2022 · 1 comment · Fixed by #1846
Labels
bug an unexpected problem or unintended behavior

Comments

@IndrajeetPatil
Copy link
Collaborator

A minimal version of code I found in the wild that seems to cause problems for fixed_regex_linter():

strsplit("a/b", "\\/")
#> [[1]]
#> [1] "a" "b"

library(lintr)

lint(
  text = 'strsplit("a/b", "\\/")',
  linters = fixed_regex_linter()
)
#> <text>:1:18: error: [error] '\/' is an unrecognized escape in character string starting ""\/"
#> strsplit("a/b", "\/")
#>                  ^

Created on 2022-12-13 with reprex v2.0.2

@IndrajeetPatil IndrajeetPatil added the bug an unexpected problem or unintended behavior label Dec 13, 2022
@MichaelChirico
Copy link
Collaborator

I guess it's the same fix as #1545

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants