Regex Escape Tool
Paste text to escape its regex special characters.
Result
How to use
- Enter your values in the fields above.
- Press Calculate to see your result instantly.
- Use the Share button to copy a link to your result.
About this calculator
Regular expressions treat certain characters as metacharacters with special meaning — a period matches any character, an asterisk means zero or more, parentheses group patterns, and so on. If you want to search for those characters literally (a period in a filename, a dollar sign in a price), you have to escape each one with a backslash so the regex engine treats it as plain text instead of an instruction.
This tool automatically prefixes every metacharacter in your input — including the period, asterisk, plus, question mark, parentheses, brackets, braces, pipe, caret, dollar sign, and backslash itself — with a backslash, producing a string safe to drop into any regex pattern. It's equivalent to what functions like JavaScript's RegExp.escape, Python's re.escape, or PHP's preg_quote do programmatically.
Developers reach for this when building a regex dynamically from user input — like a search box — where an unescaped special character would either throw a syntax error or silently match the wrong things.
Was this helpful?
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)