1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Merge pull request #3893 from josh/escape-literal-bracket-regexp

Escape literal ] in regexp
This commit is contained in:
Michael Ficarra 2015-03-08 22:18:16 -07:00
commit 37a376497c
2 changed files with 2 additions and 2 deletions

View file

@ -946,7 +946,7 @@
HEREDOC_INDENT = /\n+([^\n\S]*)(?=\S)/g;
REGEX = /^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*])*)(\/)?/;
REGEX = /^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*\])*)(\/)?/;
REGEX_FLAGS = /^\w*/;

View file

@ -841,7 +841,7 @@ REGEX = /// ^
| \\[^\n] # anything but newlines escaped
| \[ # character class
(?: \\[^\n] | [^ \] \n \\ ] )*
]
\]
)*) (/)?
///