Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 623 Bytes

File metadata and controls

23 lines (17 loc) · 623 Bytes

RegExpConstructor (interface)

interface RegExpConstructor {
  escape(str: any): string;
}

RegExpConstructor.escape (method)

The function RegExp.escape accepts an input string and prefixes with \ those characters in that string which have a special meaning when appearing in a regular expression.

The implementation is based on the stage 2 ECMAScript proposal of the same name: https://github.com/tc39/proposal-regex-escaping

escape(str: any): string;