Skip to content

Find and Replace Text

Replace words, phrases or patterns with as many rules as you need. Plain text or regex with $1 groups, live match counts, a preview of every change and undo.

Rules

Preview

Preview mode

or press Ctrl+Enter in the text box

Related Tools

Remove Extra Spaces Remove Line Breaks Sort Lines Case Converter Text Diff Checker Remove Punctuation

How to Use

  1. Paste your text — Paste the text you want to change into the text box. It can be an article, a list, code, CSV data or a whole document.
  2. Add your rules — Type what to find and what to replace it with. Tick Regex for patterns, Match case, Whole word or Keep case as needed, and add more rules with Add rule or pick a ready-made preset. Each rule shows its number of matches as you type.
  3. Check the preview — The preview marks every deletion in red and every insertion in green, so you can see exactly what will change. Switch to "Show result" to read the final text.
  4. Replace all, then copy — Press Replace All (or Ctrl+Enter in the text box). Copy or download the result, and use Undo and Redo to step back and forth.

About Find and Replace Text

WritePadPro’s Find and Replace Text tool edits text in bulk with a list of rules. Each rule can be a plain phrase or a regular expression, and you see the number of matches for every rule and a marked-up preview of all changes before anything is replaced. It is built for clean-up jobs that a word processor’s single find box makes tedious: renaming terms across a document, reformatting dates and names, fixing quotes and spacing, or turning a list into CSV.

How rules work

Rules run from top to bottom, and each rule sees the text produced by the rules above it. If rule 1 replaces “colour” with “color” and rule 2 replaces “color” with “hue”, both spellings end up as “hue”. Rules can be switched off without deleting them, reordered with the arrow buttons, and combined with presets such as “Curly quotes → straight quotes” or “Remove spaces at line ends”.

Regular expression quick reference

PatternMatches
\d \w \sa digit, a word character (A–Z, a–z, 0–9, _), a space, tab or line break
\p{L} \p{Lu}any letter in any script, any capital letter
.any character except a line break
[aeiou] [^0-9]one of the listed characters, any character except a digit
+ * ? {2,4}one or more, zero or more, optional, between 2 and 4 times
^ $start and end of a line
\ba word boundary
(…) (?<name>…)a numbered group, a named group
a|ba or b
(?=…) (?<=…)followed by …, preceded by … (not included in the match)

Replacement tokens (regex rules)

TokenInserts
$1 … $99 (or \1 … \9)the text of a numbered group
$<name>the text of a named group
$&the whole match
$$ or \$a dollar sign
\n \t \\a line break, a tab, a backslash

In plain-text rules the replacement is inserted exactly as typed, so a price such as “$15” stays “$15”.

Worked examples

Built-in protection against runaway patterns

Some regular expressions take exponential time on certain inputs. A classic example is (a+)+$ run against a long row of a’s followed by another character. Before searching, the tool checks every pattern for nested repetition and for repeated alternatives that overlap, and rejects them with an explanation. Searches also run in a separate background worker that is stopped after three seconds, so the page stays responsive whatever you type.

Preview and undo

The preview compares your text with the result word by word: removed text is struck through in red and inserted text is underlined in green. Replace All applies every rule at once, and the Undo and Redo buttons step through your changes. Up to 500,000 matches per rule are replaced; the rule shows a notice if a search stops early.

Privacy

All searching and replacing runs in your browser. Your text is never uploaded or stored. Rules are kept only if you tick “Remember my rules in this browser”, and then only on this device.

Frequently Asked Questions

Can I replace several different words at once?

Yes. Add as many rules as you need. They run from top to bottom, and each rule works on the text as the previous rules left it, so order matters: use the arrow buttons to move a rule up or down. To swap two words, use a placeholder: cat → @@TEMP@@, then dog → cat, then @@TEMP@@ → dog.

How do I use capture groups such as $1?

Tick Regex, put brackets around the parts you want to keep in the Find pattern, and refer to them in the replacement as $1, $2 and so on. For example, find (\w+), (\w+) and replace with $2 $1 turns "Smith, John" into "John Smith". Named groups work as (?<year>\d{4}) and $<year>, $& inserts the whole match and $$ inserts a dollar sign. \1 to \9 are accepted as aliases of $1 to $9.

How do I find or insert line breaks?

Tick Regex. In the Find box, \n matches a line break and \t a tab; in the Replace box, \n inserts a line break and \t a tab. For example, find ", " and replace with \n to put each comma-separated item on its own line, or find \n and replace with ", " to join lines. In plain-text rules, a backslash is just a backslash.

What does Whole word do with accented or non-English words?

Whole word only matches when the text is not part of a longer word, using Unicode letters, digits and marks as word characters. So café matches in "un café noir" but not in "cafés", and it works the same way for Cyrillic, Greek, Arabic and other scripts that separate words with spaces.

Why was my regular expression rejected as too complex?

Patterns that repeat a group which already repeats, such as (a+)+, or that repeat alternatives able to match the same text, such as (\w|\d)+, can take an astronomically long time on some inputs (catastrophic backtracking) and lock up the browser tab. The tool refuses those patterns and explains why; rewrite them without the nested repetition, for example a+ or \w+. Every regex search also runs in a background worker that is stopped after 3 seconds.

What does Keep case do?

Keep case adapts the replacement to the capitalisation of each match: replacing cat with dog turns CAT into DOG, Cat into Dog and cat into dog. It is useful when a word appears at the start of sentences, in headings and in running text.

Which regex syntax is supported?

JavaScript (ECMAScript) regular expressions with the multiline flag always on, so ^ and $ match at the start and end of every line. Character classes, quantifiers, groups, named groups, lookahead and lookbehind are supported, and so are Unicode property escapes such as \p{L} (any letter) and \p{Lu} (capital letters). The dot does not match line breaks; use [\s\S] for "any character". Possessive quantifiers and atomic groups from other regex flavours are not available.

Are my text and rules saved or uploaded?

Your text is never uploaded or saved: all searching and replacing happens in your browser. Rules are forgotten when you close the page unless you tick "Remember my rules in this browser", which stores only the rules (not your text) on this device.