Skip to main content

Escape for regex

Put a backslash before every character that has a meaning in regular expressions, so the text is matched exactly, e.g. 1+1=2? to 1+1=2?.

Command in the String toolkit · id ooa.string/escape_regex · 1 input (1 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
TextStringYesText to escape.

Outputs​

OutputTypeWhat it is
resultStringThe text, safe to use inside a regular expression.