Developer ToolsDebugging ToolsFree Tool
Regex Replace
Run a real find-and-replace on text using a regex pattern and replacement string.
How to Use Regex Replace
- 1Enter your regex pattern
- 2Add ---, then your replacement text
- 3Add ---, then the text to run it against
- 4Click Process to see the result
Frequently Asked Questions
Three parts separated by lines containing just ---: the pattern, the replacement text, and the string to run it against.
All matches — the pattern is compiled with the global flag, so every occurrence is replaced.
Yes — this uses JavaScript's native String.replace(), which supports $1, $2, etc. for numbered capture groups, and lt;name> for named groups.
No — the replace operation happens entirely in your browser.
Related Tools
Regex Tester
Test a regex pattern against sample text and see every match, using the real JavaScript regex engine.
Regex Debugger
Test a regex against sample text and see each match with its index position and any named/numbered capture groups.
Regex Split
Split text into parts using a regex pattern as the delimiter, and see each resulting piece.
Regex Reference
View a reference sheet of common regex patterns and syntax basics — the same static content as the Regex Generator tool.