Fix #47
diff --git a/R/util.R b/R/util.R
index 7f54e2a..7b7c158 100644
--- a/R/util.R
+++ b/R/util.R
@@ -55,8 +55,8 @@
   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)
   x <- gsub("\\*", "\\\\*", x)