Text Replacer

Text

Find and replace text with support for case-sensitive matching, whole word matching and regular expressions. Replace all occurrences at once with live preview.

Waiting for input
Input
0 lines
Result
0 lines

About Text Replacer

This find-and-replace tool supports plain text, case-sensitive, whole-word, and regex modes. Regex accepts g/i/m/s/u/y flags with backreferences ($1-$9). All matching runs locally via String.prototype.replace and the V8 RegExp engine - nothing uploaded, safe for sensitive logs and code. Real-time preview with match count. All processing is local - no data upload.

How to Use

  1. Open the Text Replacer tool page
  2. Enter or paste your data into the input area
  3. View the real-time results and use the copy button to get the output

Use Cases

  • Rename variables in bulk — Globally replace old identifiers during code refactoring; whole-word mode prevents substring matches.
  • Log redaction — Use regex to match phone numbers and ID numbers, replacing them with asterisk masks in log files.
  • Config file updates — Batch-replace environment URLs, ports, and key placeholders in YAML or JSON configs.
  • Template placeholder fill — Replace mustache-style template variables with actual values using capture-group backreferences.
  • Normalize whitespace — Unify Windows and Unix line endings, or trim leading and trailing spaces from each line.

FAQ

Does it support regex replacement?

Yes. Switch to regex mode to enter patterns and use $1 backreferences for dynamic substitution, compatible with g/i/m/s/u flags.

What is the difference between whole-word and normal matching?

Whole-word matching uses word-boundary assertions, so replacing cat will not match category or scatter, ideal for precise identifier replacement.

Can I preview replacements in real time?

Yes. The output area refreshes instantly with a match count each time you change the matching criteria, so you can confirm before copying.

Does it handle multiline text?

Yes. With the m flag, ^ and $ match the start and end of each line; the s flag makes the dot match newline characters.

Is my data uploaded to a server?

No. All matching and replacement runs locally in the browser via the RegExp engine with no network requests, safe for sensitive content.

Advertisement

Comments

No comments yet. Be the first!

Comments are stored locally in your browser. Configure Giscus for cloud-based comments.