130 of 149 tools live Roadmap LatestImage to Text

Regex Replace

Find and replace with a regular expression, with every match shown before you commit.

Works in your browser. Nothing you type is sent to us.

/ /

Matches
Cheat sheet

Tested in your browser with its own regular expression engine, the one JavaScript uses. Nothing you type is sent to us.

Regex Replace at a glance

Price
Free
Data sent to us
None, it runs in your browser
Sign-up
Not needed
Engine
The browser's JavaScript engine
Flags
g, i, m, s, u
Limit
2,000 matches shown per run

How to use Regex Replace

Takes about 1 minute. You need a pattern and some text to test it on.

  1. Type the patternEnter it without the surrounding slashes and tick the flags you need. An error under the box means the pattern does not compile yet.
  2. Paste the textMatches light up as you type; the list on the right shows each one with its groups.
  3. Try a replacementType into Replace with to see the text with the matches replaced, then copy the matches or the result.
Regex Tester: See exactly what your regular expression matches, as you type, with the groups and a replace preview.

Type the pattern, paste the text and type the replacement: the matches light up in the text and the result appears below with every match swapped, using $1, $2, $<name> or $& to carry parts of the match into the replacement. Copy the result when it looks right. It is the quickest way to reshape a list, fix a format across a file or prototype the replacement line for a script.

How it works

Regex Replace is a web page that does its work on your own device. Everything you type or choose is worked out by your browser and never sent to a server, so nothing is stored and there is nothing to delete. There is no account, no sign-up and no limit on how often you use it.

Reordering with groups

Capture the parts you want to keep and write them back in a new order: pattern (\d{2})/(\d{2})/(\d{4}) with replacement $3-$2-$1 turns US dates into ISO dates in one go.

Questions

How do I put a literal dollar sign in the replacement?

Write $$. A single $ followed by a digit or < is read as a group reference.

Other shortcuts

More

Privacy policy · Support · Changelog

Suggest a tool

Tell us what the tool should do. If we build it, we will let you know.

Used only to reply to you. See our Privacy Policy.