Zum Inhalt springen

Suchen und ersetzen

Suchen und ersetzen mit optionaler Regex, Gross-/Klein-Sensitivität und Live-Trefferzähler - im Browser.

Läuft in deinem Browser

Text einfügen, Such- und Ersetzungs-Muster eintippen, Treffer in Echtzeit zählen sehen. Optional Regex (Gruppen, Alternation, Lookaround), Case-Insensitiv, Ganzwort.

2 Treffer

So funktioniert's

  1. Paste your text and type the find pattern

    Match count updates as you type. Toggle regex / case / whole-word as needed.

  2. Type the replacement

    Plain text, or back-references like $1 in regex mode. Empty replacement deletes the matches.

  3. Copy the result

    Output appears in the right pane. Copy back to wherever you got the text from.

Was ist das?

A find-and-replace tool scans a body of text for occurrences of a pattern and substitutes each with a chosen replacement. Plain-text mode does literal string matching; regex mode interprets the pattern as a JavaScript regular expression with groups, alternation and look-arounds. The replacement supports back-references like $1, $2 when regex is on.

Wann verwenden

Renaming a variable across a code snippet pasted from somewhere; switching every 'colour' to 'color' for an American audience; pulling phone numbers out of free-text and normalising the format; replacing curly quotes with straight quotes before committing to a database. Any one-off text transformation that's faster than opening an editor.

Häufige Fehler

Forgetting to escape regex metacharacters in plain-text mode - dot, parens, plus, asterisk are literal in plain-text but special in regex. Using greedy quantifiers when lazy was needed: '.*' matches as much as possible; '.*?' matches as little. And not previewing match count before hitting replace - it's the single best sanity check that the pattern does what you think it does.

FAQ

Does it support regex?
Yes - toggle 'Regex' and the find pattern becomes a JavaScript regular expression. Capture groups are addressable in the replacement as $1, $2, etc.
What about replacing across newlines?
In regex mode, the 's' flag (dotall) is on by default so '.' matches newlines. Plain-text mode just looks for literal substrings, so newlines in your find pattern are matched as-is.
Can I replace with newlines?
Yes. Type \n in the replacement (regex mode) and it expands to an actual newline. In plain-text mode, paste a real newline into the replacement field if your input supports it, or use regex mode.

Mehr in dieser Kategorie