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

Escape literal ] in REGEX

] is not allowed in the PatternCharacter set
This commit is contained in:
Joshua Peek 2015-03-08 21:59:09 -07:00
parent c7a365b6f1
commit 83744917b0
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 \\ ] )*
]
\]
)*) (/)?
///