RegExp

Methods

escape

top ↑escape

RegExp.escape(String string) -> String new

Description

Escapes all the command characters in the string so it can safely be used as a part of a regular expression:

Example

RegExp.escape('[{!}]'); // -> "\[\{\!\}\]"