Skip to main content
Preparing workspace

Find and Replace Tool

Replaces every match, not just the first: the pattern always compiles with the global flag. Literal mode escapes your term; regex mode adds $1 groups.

Still loading. If the tool doesn’t appear, reload this page.

About this tool

Find and Replace Tool

Replace text in bulk, with optional regex and case-insensitive matching.

Paste text, type what to find and what to put in its place, and every occurrence is swapped at once — the replacement always runs with the global flag, so it never stops at the first match. By default the search term is escaped and matched literally, so characters like a dot, a plus sign or a bracket mean themselves; flip the regex toggle to interpret the pattern as a JavaScript regular expression with capture groups, and flip the ignore-case toggle to add the case-insensitive flag. Output updates as you type and an invalid pattern prints the engine's own error instead of silently failing.

How to use Find and Replace Tool

  1. Paste your text into the Input panel, or press Load sample to start from "cats are great, cats are cute".

  2. Enter the search term under Find and its substitute under Replace, then set the Regex and Ignore case toggles.

  3. The Result panel rewrites as you type and prints the JavaScript engine's message on a broken pattern; press Copy to take the output.

Why use Find and Replace Tool

  • Literal mode is genuinely literal

    With regex off, the search term is escaped before compiling, so searching for a period, an asterisk or a parenthesis matches that character instead of behaving as a wildcard.

  • Regex and case-insensitivity are separate switches

    You can run a case-insensitive plain-text swap without learning regex syntax, or a case-sensitive regex, instead of being forced into one combined mode.

  • Bad patterns tell you why

    An unbalanced bracket or a stray quantifier returns the JavaScript engine's message rather than an empty box, so you can see exactly which part of the pattern failed.

Common use cases

  • You exported a list of file paths and need every occurrence of an old folder name swapped for the new one before pasting it into a script
  • A draft uses a product's old name in forty places and you want them all changed in one pass, including the capitalised versions at the start of sentences
  • You have a column of dates written as 2026/07/29 and want to reorder them with a regex like (\d{4})/(\d{2})/(\d{2}) replaced by $3-$2-$1

Frequently asked questions

Which mode options does this tool cover?

1 plus the general find & replace mode: Bulk. Pick one at the top of the tool; the page link updates (for example ?v=bulk) so you can bookmark or share that exact view.

Link to answer
Does it replace every match or only the first?

Every match. The pattern is always compiled with the global flag, so a single run swaps all occurrences in the text — there is no first-only mode. Ignore case adds the case-insensitive flag on top of it.

Link to answer
How do I use capture groups in the replacement?

Turn on the regex toggle, wrap the parts you want to keep in parentheses, then refer to them in the replacement as $1, $2 and so on. $& inserts the whole match, and $$ inserts a literal dollar sign — those replacement tokens are interpreted whether or not regex mode is on.

Link to answer
Why does my search for a dot match every character?

That only happens when regex mode is on, where a dot is the any-character wildcard. Turn regex off and the term is escaped for you, or keep regex on and write the dot as \. so it matches a literal period.

Link to answer
Can it replace line breaks or invisible characters?

Yes, in regex mode: \n matches a newline, \t a tab and \s any whitespace, so a pattern like \n{2,} collapses runs of blank lines. In literal mode you can also paste the actual character into the find box and it will be matched as typed.

Link to answer