powered by
Escapes any characters that would have special meaning in a reqular expression.
escapeRegex(string)
The value of the string with any characters that would have special meaning in a reqular expression escaped.
string being operated on.
Charles Dupont Department of Biostatistics Vanderbilt University
Maintainer: Gjalt-Jorn Peters gjalt-jorn@userfriendlyscience.com
escapeRegex will escape any characters that would have special meaning in a reqular expression. For any string grep(regexpEscape(string), string) will always be true.
escapeRegex
grep(regexpEscape(string), string)
grep, Hmisc, https://hbiostat.org/R/Hmisc/, https://github.com/harrelfe/Hmisc
grep
Hmisc
string <- "this\\(system) {is} [full]." escapeRegex(string) # \dontshow{ if(!any(grep(escapeRegex(string), string))) { stop("function escapeRegex failed test") } # }
Run the code above in your browser using DataLab