Skip to content
Toolcroft

Find and Replace Text: Online Tool

Text Tools

Find and replace text online with optional case-sensitive or whole-word matching, plus a separate JavaScript regex mode. Paste text and replace all matches.

3 matches found

Find and Replace

Paste or type your text and replace all matching occurrences. Plain-text search is the default, with optional case-sensitive and whole-word matching; select Regex mode to use a JavaScript pattern instead.

Options

  • Case sensitive: treats uppercase and lowercase as distinct.
  • Whole word: only matches the exact word, not substrings. This option is disabled in Regex mode; add \b boundaries to your pattern instead.
  • Regex mode: the find field is treated as a JavaScript regular expression. Capture groups work in the replacement (e.g., $1).

Regex mode guide

In regex mode, capture groups let you rearrange and transform text. Use parentheses to capture parts of the match and reference them in the replacement string:

  • Find: (\d4)-(\d2)-(\d2) — captures a date in YYYY-MM-DD format
  • Replace: $2/$3/$1 — reformats it as MM/DD/YYYY

Regex mode uses JavaScript regular expressions with a global g flag and adds i unless Case sensitive is enabled. It does not enable multiline m or dotAll s: ^ and $ use whole-text anchors instead of matching each line, and . does not match line breaks.

Common regex patterns

PatternMatchesExample
\d+One or more digits42, 1000
\s+One or more whitespace charactersspaces, tabs
[A-Z]Any uppercase letterA, B, Z
^line"line" at the start of the entire textline 1, if the text starts with it
\bword\bWhole word boundary"word" not "sword"
(foo|bar)Either "foo" or "bar"foo, bar

Use cases

  • Bulk variable renaming: rename a variable throughout a code snippet without affecting partial matches.
  • Date format normalization: convert between ISO dates, US dates, and European dates using capture groups.
  • Whitespace cleanup: replace multiple spaces with a single space, or strip trailing spaces from each line.
  • Markdown cleanup: remove or replace specific formatting patterns across a long document.

Privacy

All processing is done locally in your browser. Your text is never sent to a server.

Browse all text tools