deno.com

method RegExpConstructor.escape

#RegExpConstructor.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.

Parameters #

#string: string

The string to escape.

Return Type #

string