Skip to main content
PulsarKit

Find and replace text

Swap words, phrases or regex matches, up to twenty rules in one pass, with whole-word matching that works in every alphabet.

Drop your files here

.txt, .md, .csv, .json, .html · up to 5 MB

How to Replace

  1. 1

    Paste your text

    Or drop a .txt, .md, .csv, .json or .html file.

  2. 2

    Say what to find and what to put there

    Add more pairs to run several replacements in one pass.

  3. 3

    Replace and copy

    The result appears below, ready to copy or download.

Whole-word matching that works in Russian too

Almost every find-and-replace uses the regular expression word boundary for whole-word mode, and that boundary is defined in terms of the characters A to Z, 0 to 9 and underscore. In any other alphabet it lands in the wrong place or matches nothing at all: searching for a whole word in Cyrillic fails. Whole-word mode here is built from Unicode letter and number classes instead, so it treats Russian, Greek, Arabic and accented Latin exactly the way it treats English, and it still does the thing you want, which is matching cat without touching cats.

A dollar sign stays a dollar sign in plain mode

In a replacement string, $1 means the first capture group and $& means the whole match. That is useful in regex mode and a trap everywhere else: type a price of $100 as a replacement and a naive tool eats part of it. Here the dollar is escaped automatically in plain and whole-word modes, so what you type is what you get, and the special meanings are available only in regex mode where you asked for them.

Several rules in one pass, applied in order

Up to twenty find-and-replace pairs run one after another, and the order matters: the output of the first is the input of the second. That is deliberate and worth using: it lets you normalise something and then act on the normalised form, in one pass over a file. It is also the thing to check when a result surprises you: if the second rule matches something the first rule created, you will see it in the output rather than in the original.

A regular expression cannot freeze this tab

Some patterns take exponential time on quite short input. The classic is a repeated group inside another repeat, which on twenty-five characters can run for longer than anyone will wait, and a regular expression engine cannot be interrupted from the outside once it starts. So regex replacements here run in a separate worker thread with a three-second budget, and when the budget runs out the whole thread is destroyed. The page stays responsive, you get a clear message rather than a dead tab, and the suggestion to switch to plain text search is right most of the time.

Your text never leaves the browser

Reading the file, matching and replacing all happen on your device. There is no upload, no server, no account, and nothing is stored; even the worker thread that runs regular expressions is inside your browser. Close the tab and everything is gone.

Frequently asked questions

How does regex mode work?

The search field is used as a JavaScript regular expression, with Unicode support switched on. Capture groups, lookbehind and property escapes such as \p{L} all work, and an invalid pattern is reported with the engine's own error message rather than a vague failure.

What does $1 mean?

In regex mode it inserts the first capture group into the replacement, so searching for (\w+) (\w+) and replacing with $2, $1 swaps two words. In plain and whole-word modes a dollar sign is literal.

How is whole word different from plain search?

Plain search finds cat inside cats and concatenate. Whole word matches only where the text either side is not a letter, digit or underscore, in any alphabet, not just Latin.

Why did my replacement stop with a timeout?

The pattern took more than three seconds, which almost always means nested repetition such as (a+)+ that makes the engine try an exponential number of possibilities. Rewriting it without the nested repeat, or using plain text search, fixes it.

Can I replace several different words at once?

Yes, up to twenty pairs. They run in order, so a later pair sees the text as earlier pairs left it.

Is my text uploaded?

No. Everything runs in your browser and nothing is sent to a server.

How large a file can it take?

Up to 5 MB or a million characters. Larger files should go through the text splitter first.

Related tools