CruxDevCruxDev Tools Prompts
text Utility • Zero-Server Privacy • 100% Client-Side

Find & Replace Text

Find and replace across any text with match case, whole word and full regex with $1 and named-group replacements - see the replacement count live.

Overview

Finds and replaces text across any block you paste, with Match case, Whole word and full regular-expression modes. The result and the number of replacements update as you type, so you can see exactly what a pattern will change before you copy it or apply it back to the input for another pass.

How It Works

Type the text to look for in Find and its replacement in Replace with. The Result panel shows the replaced text immediately, and the status line shows how many replacements were made, or an error message if a regular expression is invalid. Match case makes the search case-sensitive, Whole word skips matches inside longer words, and Regex treats Find as a JavaScript regular expression. Apply to input copies the result back into the input box so you can chain several replacements; Copy puts the result on your clipboard.

Step-by-Step Usage Guide

  1. Paste the text into Input text.
  2. Enter what to find and what to replace it with.
  3. Turn on Match case, Whole word or Regex as needed and check the replacement count.
  4. Copy the result, or click Apply to input to make another replacement on top of it.

Technical Specifications & Standards

In plain mode the tool escapes every regular-expression character in your search, so a dot, plus or bracket matches itself and nothing else. The replacement is literal too. That matters because the browser's own String.replace treats a dollar sign in the replacement as special even when you search for plain text: replacing a price with

amp; would insert the matched text instead of the characters
amp;. Here, plain mode always inserts exactly what you typed. Regex mode switches on the full JavaScript pattern syntax with the Unicode flag, and the replacement then understands $1 to $99 for numbered groups,
lt;name> for named groups,
amp; for the whole match and $ for a literal dollar sign. That is enough to reorder dates, for example (\d+)-(\d+)-(\d+) replaced with $3/$2/$1, or to flip names with (?<first>\w+) (?<last>\w+) replaced with
lt;last>,
lt;first>. Whole word is implemented with Unicode-aware lookarounds rather than \b, because \b only understands ASCII letters and would treat é or ü as a word boundary. With the option on, cat matches in the cat sat but not in category, and the same holds for accented and non-Latin words. Every match is replaced: there is no replace-once mode, so check the replacement count. An invalid pattern never changes your text; the tool shows the error and leaves the input untouched.

Targeted Use Cases

  • Renaming a variable or term throughout a pasted file without touching longer words that contain it.
  • Reformatting dates, phone numbers or names with regex capture groups.
  • Cleaning exported data, such as replacing semicolons with commas before importing a CSV.
  • Updating old URLs or product names across a block of documentation or email copy.

Notes & Gotchas

  • Turn on Whole word when replacing short terms, so id does not also change inside width or hidden.
  • Check the replacement count before copying; an unexpectedly high number usually means the pattern is too broad.
  • Use plain mode unless you need patterns, because it treats every character literally and cannot misfire.
  • Chain simple replacements with Apply to input rather than writing one complicated regular expression.

Frequently Asked Questions

How do I use capture groups in the replacement?

Turn on Regex, wrap parts of the pattern in parentheses, and refer to them as $1, $2 and so on in Replace with. Named groups written as (?<name>...) are available as

lt;name>. Use $ for a literal dollar sign.

Why does a dollar sign in my replacement behave differently in regex mode?

In regex mode, $ starts a group reference such as $1 or

amp;. In plain mode it is always literal. If you need a literal $ in regex mode, type $.

Does Whole word work with accented or non-English words?

Yes. Word boundaries are checked with Unicode letter and digit classes, so words with é, ü, Cyrillic or other scripts are matched as whole words correctly.

Is my text uploaded?

No. Find and replace runs in your browser with JavaScript, and the text never leaves your device.