Skip to content
cosmodev ~/tools/find-replace

Zoeken & Vervangen

Text & String

Zoek en vervang tekst met letterlijke of regular-expression matching, globaal vervangen, hoofdlettergevoeligheid, hele woorden en capture-group-substitutie. Live matchteller.

Probeer:

(Documentatie in het Engels)

What it does

Replaces every occurrence of a term in any text — literal or regular-expression matching — with a live result panel and a replacement counter. Runs 100% client-side; nothing leaves your browser.

How to use it

  1. Set Find (the literal text or regex pattern) and Replace with (plain text, or $1–$9 capture groups and $& for the whole match in regex mode).
  2. Paste or type your text into Input (or pick a Try chip to load a worked example). Clear empties the input.
  3. Toggle the options — each is independent:
    • Regular expression (default off): treat Find as a regex instead of literal text. Capture groups become available in the replacement.
    • Case sensitive (default on): Cat and cat only match when identical. Turn it off to match any casing.
    • Whole word (default off): only match cat as a standalone word, skipping catalog. Works in literal and regex mode. Replacing is always global — every occurrence is replaced.
  4. Read the Result panel on the right: the replaced text, the replacement count in the header, Copy, and Download (replaced.txt, shown once there is real output). The full state is encoded in the URL, so a paste of the address reproduces your exact scenario.

Examples

All verified against the live engine.

Literal, case sensitive (default)

Find cat, Replace dog in The cat sat on the cat mat. → The dog sat on the dog mat. — 2 replacements.

Regex with a capture group

Regular expression on. Find (\d+), Replace [$1] in a1b2c3 → a[1]b[2]c[3] — 3 replacements.

Whole word vs. substring

Find cat, Replace dog in the cat in the catalog:

  • Whole word off → the dog in the dogalog — 2 replacements.
  • Whole word on → the dog in the catalog — 1 replacement (the standalone cat only).

Case-insensitive

Case sensitive off. Find cat, Replace dog in Cat cat CAT → dog dog dog — 3 replacements.

Whole-match reference

Regular expression on. Find \w+, Replace <$&> in hello world → <hello> <world> — 2 replacements.

Invalid regex

Regular expression on. Find [ → the result panel switches to the error state (Invalid regular expression: missing terminating ] for character class) and your input stays unchanged. Errors show inline — never as a popup.

Good to know

  • Private: runs entirely in your browser.
  • Empty Find returns the input unchanged with 0 replacements.
  • The replacement count updates live in the result header as you type.
  • Related tools: Regex Explainer, Sort Lines.
Broncode14 talen

100% client-side · je gegevens verlaten je browser nooit. Handig gevonden? Deel hem met een collega.