Home / Text / Text Replace

Text Replace

Find, Replace, an optional regular expression, and a Times box that starts at two.

Text Replace — Runs locally

Actions

  
  
Copied! Error!
How to use

Using this tool

Text Replace finds and replaces text, runs a regular-expression replacement, or repeats a block a set number of times. All of the work on Text Replace happens in this tab, so the values you enter or the files you open never travel to a server.


Controls on this page

Text Replace gives you Find, Replace, Pattern and Times. The options listed below the input on Text Replace are the ones that change how the output is produced, and every one of them applies to a single run.


  • Times defaults to 2.
  • Pattern accepts regular expressions.

How to use Text Replace

  1. Type or paste your content into the input box at the top of Text Replace.
  2. Pick the action on Text Replace that matches the job, for example Find.
  3. Press Run on Text Replace and read the answer in the separate output box.
  4. Copy the finished text from Text Replace, then clear the boxes before starting the next one.

A worked example

Find colour in a draft, put color in the Replace field and run Text Replace, and every occurrence is rewritten in one pass instead of being edited one by one.


A closer look at Text Replace

Literal replacement is safest for names and codes, because a pattern with special characters could match more than intended. The regex mode follows JavaScript syntax, so groups and backreferences behave as they do in a script. Repeat Text multiplies the whole block, which is handy for building test fixtures or repeated labels.

The output area is separate, so a replacement can be compared with the source before it is copied. A large document takes longer because the matching runs in the page rather than on a server.


Putting Text Replace to work

Text Replace combines three actions - Text Replace, Regex Replace and Repeat Text - with four fields beneath them. Find and Replace work literally, while Pattern takes a regular expression for anything the literal match cannot express.

Times defaults to 2, and it governs how many repeats Repeat Text writes into the output box. A regex pattern is applied to the whole input, so a capture group used in Replace rewrites every match in one run.


Where Text Replace helps

  • Swapping a product name across a draft.
  • Cleaning repeated markup with a pattern.
  • Duplicating a line a fixed number of times.

Precision and limits

  • Text Replace matches the literal string in the Find field, while Regex Replace interprets the Pattern field as an expression.
  • Repeat Text uses the Times field, which starts at 2, to decide how many copies to produce.
  • A replacement runs over the whole input rather than only the selected text.

Frequently asked questions

What is the difference between Text Replace and Regex Replace?

Text Replace looks for the exact characters you type; Regex Replace interprets the pattern as a regular expression.

Can I use capture groups?

The regex mode passes groups through the browser regular-expression engine, so group references follow JavaScript syntax.

What does the Times field do?

It sets how many copies Repeat Text produces; the default is 2.

Is the original text changed?

No, the result appears in the output area and the input stays as it was.