Text

Regex Replace

Replace all regexp matches.

How to use Regex Replace

Regex Replace — Replace every match of a Go regular expression. Free to use in D2i DevTools — no account required.

Steps

  1. Fill in Pattern. This field is required.
  2. Fill in Replacement. This field is required.
  3. Fill in Input. This field is required.
  4. Click Run and copy the result under the form.

Frequently asked questions

What is Regex Replace used for?

Use it to rewrite text with a pattern, including $1 style groups in the replacement.

How do I use the free online Regex Replace tool?

Fill in Pattern. This field is required. Fill in Replacement. This field is required. Fill in Input. This field is required. Click Run and copy the result under the form.

What can I paste or upload into Regex Replace?

Enter the pattern, the replacement, and the input. The pattern is RE2. In the replacement, $1 is the first group.

What output does Regex Replace give me?

The input with every match replaced. An invalid pattern returns an error and does not change the text.

Is Regex Replace free, and is my input private?

Yes — Your input is processed in memory for this request only. It is not saved to disk or the database, and it is cleared after the tool finishes.

How do I replace the whole match, not a group?

Use $0 in the replacement for the entire match. $$ inserts a literal dollar sign.

Inputs are processed in memory only and are not saved to disk or the database. Data exists only for the duration of your request.