Find & Replace

Bulk text cleanup is where typos multiply: a renamed product, a shifted date format, or a delimiter that must change across hundreds of lines. This find-and-replace tool lets you search a pasted block with a literal string or a regular expression, then substitute matches in one sweep. It is ideal for log sanitizing, CSV tweaks, and code-snippet renames when opening a full IDE is heavier than the task. Regex power also means regex risk—one greedy pattern can rewrite more than you intended—so preview mentally, keep a copy of the original, and prefer small scoped patterns. Everything runs in your browser so confidential drafts need not travel to a remote editor just to swap a phrase.

Informational only; verify critical results independently.

How to use

  1. Paste the full text you intend to modify into the working area.
  2. Enter the search string as a literal phrase, or enable regex mode for patterned matches.
  3. Type the replacement text; in regex mode use $1, $2 (or equivalent) when capture groups should be reused.
  4. Toggle case sensitivity so FOOD does or does not match food, depending on the job.
  5. Run replace-all for global cleanup, or limit scope mentally by pasting only the relevant section first.
  6. Keep an untouched copy of the original paste elsewhere—bulk replace is effectively destructive.
  7. Escape regex metacharacters (., *, +, ?, [, ], (, ), |, ^, $, \) when you meant a literal period or bracket.
  8. Normalize line endings carefully: mixed CRLF files may need \r?\n rather than a bare \n.
  9. After a large replace, spot-check the beginning, middle, and end of the output for unintended hits.
  10. Iterate with narrower patterns if the first pass over-matched; two careful passes beat one aggressive pattern.
  11. Copy the final text into your editor, spreadsheet, or ticket, then clear the box on shared machines.

Examples

  • Rename identifier foo → bar inside a pasted code sample without opening the full project.
  • Regex dates: (\d{4})-(\d{2})-(\d{2}) → $3/$2/$1 turns 2026-07-28 into 28/07/2026.
  • Collapse double spaces by replacing two spaces with one, repeating until stable.
  • Convert Windows line endings: replace \r\n with \n in regex mode for LF-only tooling.
  • Redact emails with a pattern like [A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,} → [REDACTED].
  • Swap CSV separators from semicolon to comma only after confirming no fields embed semicolons.
  • Strip trailing spaces with a regex like [ \t]+$ when multiline mode is available.
  • Change brand spelling AcmeCo → Acme Co across a marketing paste in literal mode.
  • Normalize curly quotes to straight quotes by replacing “ and ” with " carefully.
  • Rewrite phone placeholders (xxx) xxx-xxxx patterns into a single E.164-looking stub for demos.

FAQ

Which regular expression dialect is used?
When regex mode is on, patterns follow JavaScript RegExp semantics: character classes, quantifiers, capturing groups, and common anchors. Features unique to PCRE or .NET may not exist. Test unfamiliar constructs on a tiny sample first.
Why did my search find nothing?
Check case sensitivity, invisible spaces, and whether regex mode treats dots or brackets as special. A literal search for file.txt fails in regex mode unless you escape the dot as file\.txt.
How do I replace newlines safely?
In regex mode, \n matches LF. Files copied from Windows often contain \r\n. Prefer \r?\n when you need to match either form. Confirm your destination tool’s expected line ending before mass conversion.
Does replace-all change every match?
Typically yes for this class of tool. If you only want the first hit, paste a smaller excerpt or perform a more specific pattern that cannot match twice.
Can I use lookarounds and named groups?
Support depends on the browser’s JavaScript engine. Modern engines handle many lookarounds; older environments may not. Prefer portable patterns when sharing recipes with teammates.
Is this suitable for multi-gigabyte logs?
No. Browser memory and UI responsiveness limit huge files. Use streaming command-line tools (sed, awk, ripgrep pipelines) for multi-GB corpora, and keep this page for moderate pastes.
How do capture groups appear in replacements?
Grouped portions of a match can be referenced in the replacement as $1, $2, and so on in JavaScript-style APIs. Numbering follows opening parentheses from left to right. Mistaken group indexes insert empty strings.
Literal mode versus regex mode—when should I choose each?
Use literal mode for plain product names, paths without metacharacters, and teammate-proof edits. Switch to regex when the target varies systematically—dates, IDs, repeated whitespace—or when you need capture-driven rewrites.
Does text leave my device?
No. Matching and substitution run locally. Still avoid pasting secrets onto untrusted shared screens; local code does not hide shoulder surfing.

Formula / Method

Literal mode finds exact substring occurrences (optionally case-insensitive) and substitutes the replacement string for each hit. Regex mode compiles the search field as a JavaScript regular expression and applies a global replace. Capturing groups in the pattern can be referenced in the replacement via $n. Example: pattern (\d{4})-(\d{2})-(\d{2}) with replacement $2/$3/$1 transforms 2026-07-28 into 07/28/2026. Example: literal Acme → Contoso renames every exact Acme token without treating the period in Acme.inc as a wildcard unless regex mode is enabled.

Assumptions & Limitations

Not a full IDE refactor engine: it will not understand language syntax, import graphs, or string escaping inside code beyond plain text. Catastrophic backtracking is possible with pathological regexes on long inputs. Does not version your document—keep backups. Multiline and Unicode property support follow the browser, not a separate regex server. Privacy is local processing only; it is not a secure redaction guarantee for regulated data workflows.

Related guides

Related tools

Last updated: 2026-07-28