add add_header_left
diff --git a/R/util.R b/R/util.R
index a500879..802a56a 100644
--- a/R/util.R
+++ b/R/util.R
@@ -68,4 +68,18 @@
return(mapping_matrix)
}
+regex_escape <- function(x, double_backslash = FALSE) {
+ if (double_backslash) {
+ x <- gsub("\\\\", "\\\\\\\\", x)
+ }
+ x <- gsub("\\$", "\\\\\\$", x)
+ x <- gsub("\\(", "\\\\(", x)
+ x <- gsub("\\)", "\\\\)", x)
+ x <- gsub("\\[", "\\\\]", x)
+ x <- gsub("\\[", "\\\\]", x)
+ x <- gsub("\\{", "\\\\{", x)
+ x <- gsub("\\}", "\\\\}", x)
+ x <- gsub("\\*", "\\\\*", x)
+ return(x)
+}