AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
Escape special regex characters so your text is treated as a literal in regular expressions.
Enter text above to see the escaped output.
| Character | Name | Escaped |
|---|---|---|
| . | Dot / Wildcard | \\. |
| ^ | Caret / Start anchor | \\^ |
| $ | Dollar / End anchor | \\$ |
| * | Asterisk / Quantifier (0+) | \\* |
| + | Plus / Quantifier (1+) | \\+ |
| ? | Question / Quantifier (0-1) | \\? |
| ( ) | Parentheses / Group | \\( \\) |
| [ ] | Brackets / Character class | \\[ \\] |
| { } | Braces / Quantifier range | \\{ \\} |
| \\ | Backslash / Escape | \\\\ |
| | | Pipe / Alternation | \\| |
Regex escaping is the process of prefixing special regular expression characters with a backslash (\\) so they are treated as literal characters rather than as regex operators. In regular expressions, characters like ., *, +, ?, (, ), [, ], {, }, ^, $, |, and \\ itself have special meanings. When you want to match these characters literally (e.g., matching a literal dot in a filename), you must escape them.
For example, the regex pattern \d+\.\d+ matches numbers like 3.14. The dot is escaped with a backslash so it matches a literal period instead of the "any character" wildcard. Without escaping, 3.14 would also match 3a14, 3-14, or any other character in the dot position.
This tool is essential for developers working with regular expressions in programming languages, text editors, database queries, or log analysis. It helps you quickly escape user-supplied input before using it in a regex pattern, preventing both unintended matches and potential ReDoS (Regular Expression Denial of Service) vulnerabilities from unescaped input.
The 12 special regex metacharacters that typically need escaping are: ., ^, $, *, +, ?, (, ), [, ], {, }, \\, and |. The hyphen - also needs escaping inside character classes.
The basic metacharacters are standard across most regex flavors (PCRE, JavaScript, Python, Java, .NET, Ruby, Go). However, some languages like JavaScript require double-escaping when writing regex patterns in string literals (e.g., "\\." instead of "\.").
A string escape (like \\n for newline) is processed by the programming language's string parser before the regex engine sees the pattern. A regex escape (like \\. for a literal dot) is processed by the regex engine. When using regex in code, both levels of escaping may apply.
Yes, absolutely. When incorporating user-supplied text into a regex pattern, always escape special characters first. This prevents both logic errors (unintended matches) and security vulnerabilities like ReDoS attacks where crafted input can cause catastrophic backtracking.
The tool escapes all standard POSIX and PCRE metacharacters, which covers the vast majority of regex engines. The output is safe for use in JavaScript, Python, Java, .NET, PHP (PCRE), Ruby, and most other modern regex implementations.
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026