Back to Tools
Regex Replace Tool
Ultimate Regex Find & Replace
Perform complex text transformations using capture groups and advanced substitution patterns
PRO TRANSFORMATION
Side-by-Side Comparison
Original
Transformed
About the Regex Replace Tool
Find text with a regular expression and replace it, using captured groups.
How to use the Regex Replace Tool
- Enter the Find (Regex Pattern), the Replace With text (use $1, $2 for groups) and the Flags.
- Paste your text, or click Sample.
- Press Transform Text Now, then Copy Result.
Worked example
Find (\w+)\s(\w+) and replace with $2 $1. "John Smith" becomes "Smith John".
Tips
- Add the g flag to replace every match, not just the first.
- Keep a copy of the original text in case the result is not what you expected.
Frequently Asked Questions
The text captured by the first set of brackets in your pattern.