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:
commit
37a376497c
2 changed files with 2 additions and 2 deletions
|
@ -946,7 +946,7 @@
|
|||
|
||||
HEREDOC_INDENT = /\n+([^\n\S]*)(?=\S)/g;
|
||||
|
||||
REGEX = /^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*])*)(\/)?/;
|
||||
REGEX = /^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*\])*)(\/)?/;
|
||||
|
||||
REGEX_FLAGS = /^\w*/;
|
||||
|
||||
|
|
|
@ -841,7 +841,7 @@ REGEX = /// ^
|
|||
| \\[^\n] # anything but newlines escaped
|
||||
| \[ # character class
|
||||
(?: \\[^\n] | [^ \] \n \\ ] )*
|
||||
]
|
||||
\]
|
||||
)*) (/)?
|
||||
///
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue