Regex Find and Replace
Apply a JavaScript regular expression and replacement string, including numbered and named capture references.
Your input is sent to this site only after you choose Convert on server. The conversion runs for this request and no history is saved. Upload up to 4 MiB combined; Office files have a 2 MiB limit.
Enter your text
Edit the example text or paste your own content.
Choose your options
The defaults work for most files. Change a setting only when you need to.
How to use Regex Find and Replace
- Load the example or paste your own input.
- Review the settings, then select Convert on server to send input for processing.
- Review the result, then copy or download it.
What this tool helps you do
Reformat repeated text using capture groups rather than a literal search. Supply a pattern without surrounding slashes, optional JavaScript flags, and a replacement string such as $2, $1. The global flag replaces all matches; omitting it replaces the first. The output is the transformed text itself so it can be copied into an editor or downloaded.
Format rules and limitations
Replacement strings follow JavaScript substitution rules; this tool does not execute a replacement callback or user code. Patterns are limited in length and source text to two hundred thousand characters. Expensive expressions run in the bounded conversion worker and may time out. JavaScript regex behavior can differ from PCRE, Python or other engines. Use the literal replacement tool when regex syntax is unnecessary.
Example input
Ada Lovelace Grace Hopper
What should I check before relying on the output?
Replacement strings follow JavaScript substitution rules; this tool does not execute a replacement callback or user code.
Is input uploaded?
This tool sends input to this site’s conversion API after you select Convert on server. Files use bounded workers and, when needed, private temporary folders deleted after processing or cancellation. No conversion history is saved. The converter does not upload files to a third-party conversion service.