find-replace
A find and replace tool searches a body of text for a target string or pattern and substitutes it with replacement text, supporting case-sensitive matching, whole-word boundaries, and regular expressions for advanced patterns. The ZTools Find and Replace tool processes any size paste, supports multiple search/replace pairs in one pass, previews matches with a count before applying, and offers regex backreferences ($1, $2) so users can transform patterns rather than just swap fixed strings β useful for renaming variables, fixing inconsistent formatting, and bulk-cleaning data exports.
Use casesβ
Renaming a variable across a code pasteβ
Paste a function from a codebase, find every userId and replace with accountId. Whole-word matching prevents partial-match disasters like userIdValue getting mangled.
Fixing inconsistent terminology in a documentβ
A draft uses "client", "customer", and "user" interchangeably. Run three find-replaces to standardize on one term, ensuring case is preserved (Customer vs customer).
Cleaning up a CSV export with bad delimitersβ
Vendor exports CSVs with semicolons instead of commas, double-spaces between columns, and trailing whitespace. A regex find-replace rewrites them into clean, parseable CSV in seconds.
Updating dates or version strings in bulkβ
Push a documentation update from "v2.3" to "v2.4" across hundreds of references. Regex with capture groups handles "v2.3.0" through "v2.3.99" in one pass.
How it worksβ
- Paste your source text β No size limit beyond browser memory. The tool handles megabytes of text without lag.
- Enter the find pattern β Plain text by default. Toggle "regex" for pattern matching with metacharacters like \d, \w, ^, $, [...], and capture groups (...).
- Configure match options β Case-sensitive (default off), whole word (matches only complete tokens), multiline (^ and $ match line starts/ends instead of string boundaries).
- Enter the replacement β Plain text or, with regex enabled, backreferences like $1, $2 to rebuild matched groups. Empty replacement deletes matches.
- Preview and apply β Match count shows before applying. Inline highlight shows what will change. Apply replaces all; or step through one-by-one.
Examplesβ
Input: Find: "color" β Replace: "colour" (case-sensitive)
Output: Replaces "color" but leaves "Color" untouched. 14 matches found, 14 replaced.
Input: Regex find: \b(\d{3})-(\d{4})\b β Replace: $1.$2
Output: Phone numbers like "555-1234" become "555.1234". Whole-word boundary prevents matching inside longer numbers.
Input: Find: " " (multiple spaces) β Replace: " " (single)
Output: Collapses runs of whitespace to single spaces. Useful for cleaning copy-pasted text.
Frequently asked questionsβ
What's the difference between plain text and regex find?
Plain text matches the literal string you type. Regex treats the input as a pattern, where characters like . * ? + [ ] ^ $ have special meanings. Regex is more powerful but requires syntax knowledge.
How do I match a literal special character with regex?
Escape it with a backslash: \. matches a literal period, \* matches a literal asterisk, \\ matches a literal backslash. The tool can also disable regex if you only need literal matching.
Why isn't my replacement working?
Common causes: case-sensitive option mismatched, whole-word boundary excluding partial matches, regex syntax error in the find pattern, or replacement using $ without regex enabled. Check the match count first; if it's zero, the find is wrong.
Can I do multiple find-replaces at once?
Yes β toggle the "batch" mode and enter pairs as one find/replace per row. Replacements run in order, so consider whether earlier substitutions affect later ones (e.g., replacing "AB" then "B" is different from "B" then "AB").
Does the tool send my text to a server?
No β all processing runs in your browser. The text never leaves your device, which matters for sensitive documents, source code, and proprietary data.
Tipsβ
- Always preview the match count before applying β surprises usually mean the pattern matches more than you expected.
- Use word boundaries (\b in regex, "whole word" toggle in plain mode) to prevent partial-match disasters.
- For multi-line replacements, enable multiline mode so ^ and $ match each line, not just the document start/end.
- Save complex regex patterns as bookmarks β rebuilding a 30-character regex from memory wastes time.
Try it nowβ
The full find-replace runs in your browser at https://ztools.zaions.com/find-replace β no signup, no upload, no data leaves your device.
Last updated: 2026-05-05 Β· Author: Ahsan Mahmood Β· Edit this page on GitHub