Escapes all potentially meaningful regexp characters in 'unquoted'.

Usage

quote_meta(unquoted, parallel = FALSE, grain_size = 1e+05)

Arguments

unquoted
unquoted string
parallel
multithreading support
grain_size
a minimum chunk size for tuning the behavior of parallel algorithms.

Value

quoted string

Description

The returned string, used as a regular expression, will exactly match the original string.

Examples

quote_meta(c("1.2","abc"))
[1] "1\\.2" "abc"
re2_detect("1+2", "1+2")
[1] FALSE
re2_detect("1+2", quote_meta("1+2"))
[1] TRUE
re2_detect("1+2", re2("1+2",literal = TRUE))
[1] TRUE