Escape a string for regex

escape_regex(string)

Arguments

string

A string to escape.

Value

A string with escaped characters.

Examples

escape_regex("library(tidyverse)")
#> [1] "library\\(tidyverse\\)"