Skip to main content

Regex Replace

Find and replace text using regular expressions.

What does this tool do?

Direct answerRegex Replace substitutes every match with your replacement, supporting $1, $&, $' references.
Key fact$& inserts the whole match; $1…$9 insert capture groups.
ProcessingRuns locally in your browser; no data is sent to a server.

How to use

  1. Enter the pattern and flags.
  2. Enter the replacement ($1, $& supported).
  3. Click Replace matches.

Example

Input

Order 42 shipped

Output

Order [42] shipped  (pattern \d+, replacement [$&])

Who is this for?

This tool was built for people who need a fast answer in the browser — no install, no account, no data leaving the device.

Writers cleaning up drafts, developers batch-fixing text, translators, and students. Paste, transform, copy — no signup, no limits.

Frequently asked questions

How do I use capture groups?

Wrap parts in ( ) and refer to them as $1, $2 in the replacement.

What flag replaces all matches?

g — it is added automatically if missing.

Can I use lookbehind?

Yes in modern browsers; very old Safari may not support it.

More tools in this category