Escape literal \

  • \ is the escape character for strings and regexes
  • to escape a \ you need to write "\\\\"
x <- "a\\b"
str_view(x)
## [1] │ a\b
str_view(x, "\\\\")
## [1] │ a<\>b