Revert "Escape literal [ in regexp"

This commit is contained in:
Jeremy Ashkenas
2015-02-26 16:05:12 -05:00
parent 9becb0e937
commit 06aa329596
2 changed files with 3 additions and 3 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

@@ -837,11 +837,11 @@ HEREDOC_INDENT = /\n+([^\n\S]*)(?=\S)/g
# Regex-matching-regexes.
REGEX = /// ^
/ (?!/) ((
?: [^ \[ / \n \\ ] # every other thing
?: [^ [ / \n \\ ] # every other thing
| \\[^\n] # anything but newlines escaped
| \[ # character class
(?: \\[^\n] | [^ \] \n \\ ] )*
\]
]
)*) (/)?
///