ON-DEVICE PROCESSING
Regex Replace
Replace text using a JavaScript regular expression.
Apply a JavaScript regular expression to a copy of text
How to use this tool
Paste source text in the main field. In the second field enter a pattern, then a replacement on the next line, followed by flags such as gi on the third line. For example, the pattern one with replacement two and gi changes One and one to two and two. Check matches with Regex Tester before replacing a valuable document.
Check the result
Input is capped at 100,000 characters and pattern length at 200, but poorly designed expressions can still be slow. The flags must be valid JavaScript regular-expression flags. For an exact phrase without patterns, use Find and Replace Text instead.
About Regex Replace
Replace text using a JavaScript regular expression.
How to use it
Paste source text in the main field. In the second field enter a pattern, then a replacement on the next line, followed by flags such as gi on the third line. For example, the pattern one with replacement two and gi changes One and one to two and two. Check matches with Regex Tester before replacing a valuable document.
Before you use the result
Input is capped at 100,000 characters and pattern length at 200, but poorly designed expressions can still be slow. The flags must be valid JavaScript regular-expression flags. For an exact phrase without patterns, use Find and Replace Text instead.
Frequently asked questions
Can I save my result?
Run the tool, then use its download control. Text results can be saved as a file; image and audio tools show their available export links after generation. A disabled download means a new result is needed.
Are my inputs uploaded?
The tool processes your input in this browser tab. Opening the page downloads the site assets; your tool inputs are not sent to a processing server. Save your result before closing the tab.
How do I start again?
Use Restore example to reset the editable fields, then run the tool again. Changing input invalidates the previous export so that you can generate a fresh result.