string <- "this\\(system) {is} [full]."
escapeRegex(string)
escapeBS(string)
# \dontshow{
if(!any(grep(escapeRegex(string), string))) {
stop("function escapeRegex failed test")
}
if(escapeBS(string) != "this\\\\(system) {is} [full].") {
stop("function escapeBS failed test")
}
# }
Run the code above in your browser using DataLab