Find & Replace Tool
Search and replace text with plain strings or regular expressions. Supports capture groups and whole-word mode.
About This Tool
The Find & Replace Tool performs text substitution across an entire block of text in one click. Plain string mode is ideal for simple literal replacements. Regular expression mode gives full JavaScript regex power, including capture groups ($1,$2) in the replacement string, lookaheads, and character classes.
Options include case-sensitive matching (default is case-insensitive), whole-word mode (only matches text surrounded by word boundaries), and regex mode (disables whole-word since the pattern itself controls matching). All replacements happen locally in the browser.
How to Use
- Paste your text into the input area (or click Sample).
- Enter the search term in Find and the replacement in Replace with. Leave Replace empty to delete matches.
- Toggle options as needed: case-sensitive, whole-word, or regex mode.
- Click Replace All. The match count is shown next to the button.
- Copy the result.
Use Cases
Developers clean up exported data by replacing placeholder values or normalizing inconsistent formatting. Technical writers update outdated product names or version numbers throughout a document draft. Developers use regex mode to strip HTML tags, reformat dates, or extract and rearrange capture groups. Data engineers replace null string representations (like "N/A" or "NULL") with empty strings before importing data.
FAQ
- Can I use capture groups? — Yes, in regex mode. Wrap parts of the pattern in parentheses:
(fox). Reference them in the replacement with$1,$2, etc. For example, find(\w+)\s(\w+), replace with$2 $1to swap two words. - What does "whole word" mean? — Whole word mode wraps the search pattern in
\bword-boundary anchors. "fox" matches "fox" but not "foxes" or "quickfox". - Does leaving Replace empty delete the matches? — Yes. An empty replacement string deletes all matched text.
- Why is "whole word" disabled in regex mode? — In regex mode, the pattern itself controls boundary matching. Add
\bmanually in your pattern if needed.