Find and Replace

Replace text across many lines and see exactly which ones changed before you use the result.

The lines to work on. Blank lines are preserved in the output.

Leave empty to delete every match.

Use $1 in the replacement for the first capture group.

Ignored in regular expression mode.

100 runs left today · sign up for more

About this tool

Replaces text across a block of lines and shows you every line it touched, before and after.

That preview is the whole point. A bulk replace over a few hundred URLs goes wrong quietly: a term that also appears inside a longer string, a pattern that matches more than you meant, a replacement applied everywhere when you wanted it in two places. Pasting the result straight back is how a redirect map ends up with forty wrong entries that nobody notices until traffic drops.

Plain text or regular expressions. In regex mode, `$1` and `$2` in the replacement refer to capture groups, and a pattern that runs away is abandoned rather than left to hang.

Common questions

Why show the changed lines instead of just the result?

Because a replacement that matched more than you intended looks completely normal in the output. Seeing which lines moved is the only cheap way to catch it before the result goes somewhere it matters.

How do I use capture groups?

Turn on regular expressions, wrap part of the pattern in brackets, and refer to it as $1 in the replacement. Searching for ^/blog/(.*)$ and replacing with /articles/$1 rewrites a whole path structure in one pass.

What happens if my regular expression is invalid?

You get the error and nothing is changed. A pattern that runs away — the classic case is nested quantifiers on a long line — is abandoned at a backtracking limit rather than being allowed to hang.

Is my text uploaded anywhere?

It is processed on the server and sent nowhere else. It is not stored unless you are signed in and choose to save the run.