At One Place

Find and replace

Replace every occurrence of a string in pasted text, with optional regex.

How it works

Replaces every occurrence of one string with another. Case sensitivity is optional, and so is regular-expression mode for anything more structured than a literal string.

In regex mode, capture groups are available in the replacement as $1, $2 and so on — so a pattern like (\w+), (\w+) with replacement $2 $1 swaps two comma-separated fields on every line. An invalid pattern reports the error rather than silently doing nothing.

The match count is shown, which is the quickest way to confirm a pattern does what you think before you rely on the output.

This tool runs entirely in your browser. Nothing you enter is sent to a server, logged or stored, and the page keeps working with the network disconnected.

Common questions

Can I use regular expressions?
Yes. Turn on regex mode and use capture groups in the replacement with $1, $2 and so on.
How do I replace a literal dollar sign in regex mode?
Escape it as \$ in the pattern. In the replacement, $$ produces a single literal dollar sign.

Related pages