Escape literal [ in regexp

Improves compatibility with strict ES5 regexp syntax
This commit is contained in:
Joshua Peek
2015-02-26 12:37:27 -06:00
parent c7a365b6f1
commit 7f7765546f
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*/;