Skip to content
Browse tools

Find replace

Every match is highlighted in place before anything changes, and the count updates as you type the pattern. A regex you are not sure about stops being a gamble when you can see exactly what it caught.

Modes
plain · word · regex
Groups
$1 · $2 · $<name>
Preview
before you commit
Step 1

Your text

empty
Match
Step 2

Preview

View
empty
Paste some text and type something to find.
Nothing to search yet Paste some text and type something to find.

Regex quick reference

PatternMatches
\d+One or more digits — 2024, 7
\s+One or more whitespace characters, including tabs and newlines
\b\w+\bA whole word
^\s+Leading whitespace — turn on Multiline to catch it on every line
(\w+)@(\w+)Two capture groups; use $1 and $2 in the replacement
(?<year>\d{4})A named group; use $<year> in the replacement
a|bEither a or b
colou?rAn optional character — matches both spellings

Worth knowing

See it before you do it

The Matches view marks every hit in the original text. Nothing is changed until you switch to Result or press Apply, so an over-greedy pattern is something you notice rather than something you discover afterwards.

$1 is the point of regex replace

Capture what varies, then put it back in a new shape. Finding (\w+), (\w+) and replacing with $2 $1 turns Smith, John into John Smith for the whole file at once.

Whole word is not the same as plain

Replacing cat in plain mode also hits concatenate. Whole word anchors the search to word boundaries, which is almost always what you meant and rarely what you get elsewhere.

Apply is repeatable on purpose

Apply moves the result back into the input so the next find-and-replace runs on it. Chaining several passes is usually simpler than writing one clever pattern that does everything.

A broken regex is reported, not swallowed

Half-typed patterns are invalid most of the time, so the field turns red and the status line explains what the engine objected to instead of silently matching nothing.

Nothing is uploaded

All of it runs in this tab. Logs, exports and source files are exactly the sort of thing that should not be pasted into someone else's server to be edited.