Polyatic Find & Replace

Find & Replace Text

Paste text or open a .txt file, then find and replace live — plain-text matching (special characters treated literally, with whole-word and case options) or full regex with $1 group references. Nothing you paste is uploaded.

Find
Replace with

Building a pattern? The regex tester & debugger highlights groups and offsets live — prototype it there, then paste it here.

Result

0 Type a search term
waiting for a search term

Preview — matches highlighted

Matches are highlighted here as you type a search term.

Replaced output

Nothing leaves your browser. Text is matched and replaced on your own device with plain JavaScript — no network requests, no logging. Your source text is never mutated; the output is always derived. Safe for source code, contracts and logs; you can disconnect from the internet and it still works.

Plain mode vs regex mode

Most of the time you want plain-text mode, and this tool defaults to it. In plain mode the characters that are special to a regular expression — . * + ? ^ $ { } ( ) | [ ] \ — are escaped internally before any match runs, so they are treated as the literal characters you typed. That is the single most common bug in home-grown find-and-replace code: search for the price $5.00 with a naïve regex and the $ and . misbehave, either matching the wrong thing or throwing an error. Here, a.b matches only the literal a.b and never axb. Switch to regex mode deliberately, when you actually want those characters to carry their pattern meaning.

Whole-word and case options

In plain mode, Whole word only wraps your term in word boundaries so it matches a term standing on its own but not the same letters buried inside a longer word: replacing cat changes the word cat while leaving category, concatenate and scatter untouched. It is exactly what you want when renaming an identifier or a word without collateral damage. Match case is off by default (so Color and color both match); turn it on to distinguish them — useful for code, where Value and value are different things.

Worked example: swap two columns with a capture group

Suppose you have a list of First Last names and need Last, First. Switch to regex mode, put (\w+) (\w+) in the find box and $2, $1 in the replace box. Each (…) captures a word; $1 and $2 re-insert them in the new order, so John Smith becomes Smith, John on every line at once. $& inserts the whole match (handy for wrapping matches in quotes: replace \d+ with "$&"), and $$ emits a literal dollar sign. These are the standard JavaScript String.replace references — the same ones the regex tester previews.

The match count and highlighted preview

Before you trust a replace, the panel shows how many matches were found and highlights every one of them in the source text, so you can see at a glance whether your pattern is too greedy or too narrow. The replaced output updates on the same keystroke — there is no hidden "Replace" button to hunt for. Because the input is never mutated and the output is always derived from it, you can tweak the pattern freely and hit Restore original (which just clears the find and replace boxes) to get back to an untouched copy.

Honest limits

This is a text tool, not a code refactoring engine: it does not understand syntax, scope, or which count is a variable and which is a comment — whole-word and case options are as smart as it gets, so review the highlighted matches before replacing in source. Regex mode uses the browser's own engine, which is ECMAScript flavour: \d \w \s, groups, lookahead and (in modern browsers) lookbehind all work, but PCRE extras like recursion, atomic groups and possessive quantifiers do not. Everything runs in a textarea, so the practical ceiling is browser memory — comfortable for documents and source files, but a multi-hundred-megabyte log belongs in sed or perl. Line endings pass through untouched unless you match them yourself.