Browse files

Fix for regex literals with escaped slashes

  • Loading branch information...
1 parent 5c5a414 commit 095e65ec95b69d6b2514632eae5267b33fccde3c @sstephenson sstephenson committed Sep 25, 2010
Showing with 5 additions and 1 deletion.
  1. +1 −1 coffee-mode.el
  2. +4 −0 examples/edge.coffee
View
2 coffee-mode.el
@@ -247,7 +247,7 @@ path."
(defvar coffee-boolean-regexp "\\b\\(true\\|false\\|yes\\|no\\|on\\|off\\|null\\)\\b")
;; Regular Expressions
-(defvar coffee-regexp-regexp "\\/.+?\\/")
+(defvar coffee-regexp-regexp "\\/\\([^\\]\\|\\\\.\\)+?\\/")
;; JavaScript Keywords
(defvar coffee-js-keywords
View
4 examples/edge.coffee
@@ -0,0 +1,4 @@
+# Edge cases
+
+if string.match /\// or string.match /\x1b/ or string.match /a\/b/
+ console.log "matched"

0 comments on commit 095e65e

Please sign in to comment.