diff --git a/examples/code.cs b/examples/code.cs index f063ec98..621e8e17 100644 --- a/examples/code.cs +++ b/examples/code.cs @@ -21,6 +21,8 @@ spaced_out_multiline_object: { list: [1, 2, 3, 4] + regex: /match[ing](every|thing|\/)/gi + three: new Idea() inner_obj: { diff --git a/lib/coffee_script/lexer.rb b/lib/coffee_script/lexer.rb index 6f3137da..debd3aeb 100644 --- a/lib/coffee_script/lexer.rb +++ b/lib/coffee_script/lexer.rb @@ -18,7 +18,7 @@ class Lexer NEWLINE = /\A([\r\n]+)/ COMMENT = /\A(#[^\r\n]*)/ CODE = /\A(=>)/ - REGEX = /\A(\/(.*?)\/[imgy]{0,4})/ + REGEX = /\A(\/(.*?)[^\\]\/[imgy]{0,4})/ JS_CLEANER = /(\A`|`\Z)/ MULTILINER = /[\r\n]/