Skip to content

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

Closed
@IndrajeetPatil

Description

@IndrajeetPatil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions