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
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 \\ ] )*
]
\]
)*) (/)?
///