Could someone please give a complete list of special characters that should be escaped?
I fear I don't know some of them.
Take a look at PHP.JS's implementation of PHP's preg_quote function, that should do what you need:
preg_quote
http://phpjs.org/functions/preg_quote:491
The special regular expression characters are: . + * ? [ ^ ] $ ( ) { } = ! < > | : -
. + * ? [ ^ ] $ ( ) { } = ! < > | : -
2.1m questions
2.1m answers
60 comments
57.0k users