tooldura
All tools

Regex Find and Replace

Replace every match of a pattern, reusing captured groups in the replacement

Mode
//g

$1 to $9 insert a captured group, $& the whole match, $<name> a named group, and $$ a literal dollar sign.

About Regex Find and Replace

Regex Find and Replace runs a substitution over your text and shows the result as you type, next to the matches it is about to change. The replacement side is where the useful work happens: $1 through $9 drop a captured group back into the output, $& inserts the whole match, and $<name> a named group, which is how you reorder dates, rewrite links or reformat a column of data in one pass. Matching runs on a background thread with a time limit, so a pattern that backtracks out of control is stopped rather than left to freeze the page.

✦FreeNo paywalls or tiers
⬡No SignupNothing to create
⚡InstantNo setup, no install
⊞Any DeviceMobile, tablet, desktop

The guide behind this tool

The Right-Hand Side: What You Can Write in a Regex Replacement

Everything after the pattern gets one sentence in most tutorials, and that is where the mistakes live. $1 versus \1, groups that move, and the ceiling.

7 min read

How to use Regex Find and Replace

  1. 1

    Write the pattern that finds what you want to change, and keep the g flag on to change every occurrence.

  2. 2

    Put the replacement in the second field, using $1 for the first captured group.

  3. 3

    Paste your text and watch the result build underneath as you refine either side.

  4. 4

    Copy the finished text when the preview looks right.

Frequently Asked Questions

Wrap it in parentheses in the pattern, then refer to it in the replacement by number. Matching (\d{4})-(\d{2}) and replacing with $2/$1 turns 2026-08 into 08/2026. Groups are numbered by the position of their opening bracket, so nested groups count too.