PK Systems PK Systems
Text tools

Find and Replace

Search and replace across any block of text, with live preview, regex, whole-word and case-sensitive options.

Find and Replace

Preview (matches highlighted)


        

Result

What this tool does

A simple, fast find-and-replace for any block of text — without firing up a heavyweight editor. The preview pane highlights every match in yellow before you commit, replaced text turns green so you can verify the change visually, and a live counter tells you how many hits the current pattern has. Works on plain prose, code, logs, CSV — anything you can paste in.

How to find and replace

Paste the source text into the top field. Type what you're looking for in Find, and the replacement in Replace with. Tick Case-sensitive to match capitalization exactly, Whole word to avoid partial matches (e.g. "cat" won't match inside "category"), and Regex to enable full regular-expression syntax. Choose Replace all or Replace first only, then copy the result with the button beside the output.

Tips for everyday find/replace

For simple swaps, leave all options off — that's the most predictable. Turn Case-sensitive on whenever capitalization matters ("iPhone" vs "iphone"). Use Whole word when renaming a variable or word that's likely to be a substring of others. Regex unlocks captures ($1, $2), wildcards, anchors and lookaheads — but if you don't need them, leaving regex off prevents surprises with characters like ., *, ?.

Options reference

Option When to use it
Case-sensitiveMatch capitalisation exactly. Off by default, so "hello" and "Hello" both match.
Whole wordOnly match if the surrounding characters aren't letters/digits. Prevents "cat" from matching inside "category".
RegexTreat the find field as a regular expression. Use captures ($1) in the replace field for advanced rewriting.
Replace first onlyReplace only the first match. Useful for editing a single occurrence in a longer file.
Replace allReplace every match in the source text. Default behaviour.

Frequently asked questions

Does the regex option support captures?
Yes. Use parenthesised groups in the find field ((\w+)@(\w+)) and reference them in the replace field with $1, $2, etc. JavaScript regex syntax applies — \d, \s, \b, character classes, anchors and lookaheads are all available.
What's the difference between whole-word and substring matching?
By default, the find pattern matches anywhere — "cat" matches inside "category" or "vacate". With Whole word on, the match must be surrounded by non-word characters (or the start/end of the text), so only standalone "cat" matches. Use it when you're renaming a variable or replacing a short term that's a common substring.
Why does my regex show "Invalid pattern"?
Either the pattern has a syntax error (unbalanced brackets, an unfinished escape, a stray +), or it uses a feature your browser's regex engine doesn't support. The most common cause is forgetting to escape literal special characters like . or (. Toggling regex off treats them as literals automatically.
Is the replacement permanent?
Only on what you copy — the source field stays untouched until you replace it manually. The output is the post-replacement text, which you can then copy and paste back over your original. This way nothing is destroyed accidentally.
Can I leave the replace field blank?
Yes — that simply deletes every match. It's the cleanest way to strip a marker, a tag, or trailing whitespace at end of lines (use regex \s+$ with multiline mode in mind, or just toggle whole-word off and search for the literal pattern).
Does the source text leave my browser?
No. The entire find/replace runs in JavaScript on your machine. You can safely use it on private documents, code with credentials, or anything else you don't want to upload. Open DevTools > Network and watch — typing fires no requests.