regex_quote()

Learn how to use the regex_quote() function to return a string that escapes all regular expression characters.

Returns a string that escapes all regular expression characters.

Syntax

regex_quote(string)

Parameters

NameTypeRequiredDescription
stringstring✔️The string to escape.

Returns

Returns string where all regex expression characters are escaped.

Example

print result = regex_quote('(so$me.Te^xt)')

Output

result
\(so\$me\.Te\^xt\)