RegExpConstructor

interface · experimental

interface RegExpConstructor

Methods

escape

escape(string: string): string

Returns a new string in which characters that are potentially special in a regular expression pattern are replaced with escape sequences.

string: string

The string to escape.

MDN