WordsPolish.
← All Tools

Find & Replace

Plain-text and regex find-and-replace, with a plain-English guide to the patterns writers actually need.

This tool runs entirely in your browser. Nothing you type or paste here is ever sent to a server — see how the calculations work.

Search for a word or pattern across pasted text and replace every instance (or just the first, or one at a time with confirmation) — either as a literal plain-text match or, for more advanced needs, using a regular expression (regex) pattern. Most writers only ever need plain-text find-and-replace; the regex mode is here for the handful of genuinely common cases where a literal match can't do the job, like finding any number regardless of its exact digits.

Enter text and a search term to see matches and the result.

Plain-text mode, and the regex patterns actually worth knowing

Plain-text mode matches your search term exactly as typed, with a case-sensitive toggle (off by default, so "Word" matches "word" too) and a whole-word-only toggle (so searching "cat" doesn't also match inside "category").

Regex mode unlocks pattern matching instead of literal text matching. A handful of patterns cover almost everything a writer, not a programmer, actually needs: \d+ matches any run of digits (useful for finding and reformatting all numbers in a document); \s+ matches any run of whitespace (useful for collapsing inconsistent spacing, similar to what /remove-extra-spaces/ does automatically); ^ and $ anchor a pattern to the start or end of a line, useful for adding or removing a prefix/suffix on every line at once (like adding "- " to the start of every line to turn a list into bullet points); and .* matches any sequence of characters, useful as a wildcard when you know the start and end of what you're looking for but not the exact middle.

Capture groups — parts of the search pattern wrapped in parentheses — can be referenced in the replacement text using $1, $2, etc., which lets you rearrange matched text rather than just deleting or replacing it outright. For example, searching for (\w+), (\w+) and replacing with $2 $1 swaps two comma-separated words around, useful for converting a "Last, First" name list into "First Last" format in one pass across an entire list.

Who uses this

  • Batch-fixing a misspelled name or term that appears many times throughout a long document.
  • Adding a prefix or suffix to every line of a list at once using the ^ or $ line-anchor regex patterns.
  • Reformatting a "Last, First" name list into "First Last" order across dozens of entries using a capture-group replacement.

Edge cases to know about

  • Regex special characters (like . * + ? ( ) [ ] in your literal search term) need to be escaped with a backslash if you're searching for them as literal characters in regex mode — searching for a literal period with an unescaped "." will actually match any character, not just a period, since "." is a regex wildcard.
  • Whole-word matching relies on detecting a word boundary, which works reliably for standard English words but can behave unexpectedly around hyphenated words or contractions, since different definitions of "word boundary" disagree on whether a hyphen or apostrophe counts as part of the word.
  • Replace-all is irreversible within the tool itself (there's no built-in undo across a page reload) — always keep a copy of your original text before running a broad regex replace on something you can't easily reproduce.

Related tools

FAQ

Do I need to know regex to use this tool?
No — plain-text find-and-replace covers the vast majority of everyday needs (fixing a misspelled name, swapping one word for another) without any special syntax. Regex mode is there for the smaller set of cases where you need to match a pattern rather than exact literal text, like "any number" or "start of every line."
What does the dollar-sign syntax in a regex replacement mean?
$1, $2, and so on refer to the parenthesized "capture groups" in your search pattern, in order. They let you rearrange or reuse parts of the matched text in the replacement rather than just deleting it — for example, swapping the order of two matched words, or wrapping a matched number in brackets while keeping the number itself.
Can I replace only the first occurrence instead of all of them?
Yes — a "replace first only" mode stops after the first match, and a step-through mode lets you confirm or skip each match individually if you want fine-grained control rather than a blanket replace-all across the whole document.