Why use Find and Replace Text
Paste your text, type the word or phrase to look for in Find and its substitute in Replace with, and the Result panel shows the text with every occurrence swapped. A Matches found figure tells you how many replacements were made. With the sample text, finding cat and replacing with dog changes 2 matches and returns "The dog sat on the mat. The dog was happy." Matching ignores capital letters unless you tick Match letter case, and it matches inside longer words. Ticking the regular expression box lets you use patterns, capture groups and whole-word anchors. Leaving Replace with empty deletes every match.
Plain-text find and replace examples
These use the default settings: regular expression off, Match letter case off.
Rename a company in every spelling
Text: Acme Ltd signed. ACME LTD paid. acme ltd left. Find: Acme Ltd. Replace with: Acme Inc
Acme Inc signed. Acme Inc paid. Acme Inc left. (3 matches)
With Match letter case ticked, only the first is replaced and the count is 1.
Fix a repeated typo
Text: recieve, Recieve, recieved. Find: recieve. Replace with: receive
receive, receive, received (3 matches)
The capital R is lost because the replacement is inserted as typed. Run a second, case-matched pass for capitalized forms if that matters.
Change a list separator
Text: apple;banana;cherry. Find: ; Replace with: ,
apple,banana,cherry (2 matches)
Search for punctuation literally
Text: a.b.c. Find: . Replace with: -
a-b-c (2 matches)
In plain-text mode a period is just a period. Brackets work the same way: finding (1) in Total (1) and (2) replaces only the bracketed 1.
Wrap each match instead of replacing it
Text: The cat sat. The cat ran. Find: cat. Replace with: [$&]
The [cat] sat. The [cat] ran. (2 matches)
$& in the Replace with box stands for whatever was matched.
Regex find and replace patterns you can copy
Tick Treat 'Find' as a regular expression first. Every result below was produced by this tool.
| Task | Find | Replace with | Before | After |
|---|---|---|---|---|
| Whole word only | \bcat\b | dog | category cat concat Cat | category dog concat dog |
| Several words to one | cat|dog|hamster | pet | I have a cat, a dog and a hamster. | I have a pet, a pet and a pet. |
| Either spelling | colou?r | hue | colour color Colour | hue hue hue |
| Collapse repeated spaces | \s+ | one space | too many spaces here | too many spaces here |
| Line breaks to commas | \n | , | line one / line two / line three on separate lines | line one, line two, line three |
| Tabs to commas | \t | , | one / two / three separated by tabs | one,two,three |
| Strip HTML tags | <[^>]+> | (empty) | <b>bold</b> and <i>italic</i> | bold and italic |
| Mask digits | \d | # | call 555-1234 or 555-9876 | call ###-#### or ###-#### |
| Hide email addresses | [\w.]+@[\w.]+ | [email] | jane@example.com, bob@test.org | [email], [email] |
| Swap last and first name | (\w+), (\w+) | $2 $1 | Smith, John | John Smith |
| Reorder a date | (\d{4})-(\d{2})-(\d{2}) | $3/$2/$1 | 2026-10-08 | 08/10/2026 |
| Change a title, keep the name | Mr (\w+) | Dr $1 | Mr Smith met Mr Jones | Dr Smith met Dr Jones |
| Remove a tracking parameter | utm_[a-z]+=[^&]+&? | (empty) | https://example.com/page?utm_source=news&id=4 | https://example.com/page?id=4 |
Patterns use JavaScript regular expression syntax. Remember that matching is case-insensitive unless Match letter case is ticked, so \bcat\b also matches Cat.
Special codes in the Replace with box
The replacement is not always inserted literally. A dollar sign followed by certain characters has a meaning, in plain-text mode as well as regex mode.
| You type | What is inserted | Example |
|---|---|---|
| $& | The whole matched text | Find cat, replace with [$&]: [cat] |
| $1, $2 ... | The first, second ... capture group (regex mode) | Find (\w+), (\w+), replace with $2 $1: John Smith |
| $<name> | A named capture group (regex mode) | Find (?<y>\d{4})-(?<m>\d{2})-(?<d>\d{2}), replace with $<m>/$<d>/$<y>: 10/08/2026 |
| $$ | One literal dollar sign | Find (\d+) USD, replace with $$$1: $5 |
| $` or $' | The text before the match, or the text after it | Rarely wanted; write $$ when a dollar sign must be followed by a backtick or apostrophe |
| $5.00 | $5.00, unchanged when no fifth group exists | Find 5.00, replace with $5.00: It costs $5.00 |
| \n or \t | The two characters as typed, not a line break or tab | Find a comma and space, replace with \n: a\nb\nc |
Because \n is not converted in the replacement, this tool cannot insert line breaks. It can remove them or swap them for other characters.
How matching behaves, and what is not supported
- All matches are replaced. There is no replace-first-only or step-through mode.
- Plain-text mode matches inside longer words. There is no whole-word checkbox; use \b in regex mode.
- One Find and one Replace with value per run. A list of different find-and-replace pairs has to be applied one after another.
- In regex mode, ^ and $ match only the very start and very end of the whole text, not each line. Finding ^line in three lines that each start with line changes only the first.
- A period in regex mode does not match a line break. Use [\s\S] to match across lines.
- An invalid pattern, such as a lone opening bracket, shows the message "That regular expression is not valid." and nothing is changed.
- If nothing matches, Matches found shows 0 and the Result is the original text.
Plain text or regular expression: which mode to use
Use plain-text mode whenever you are looking for an exact word, phrase or symbol. Everything you type in Find is treated literally, so a period, question mark, bracket or asterisk matches only itself. Searching for e.g. in the text e.g. eggs e.g. finds 2 matches in plain-text mode.
Switch to regex mode when you need a rule rather than a fixed string: whole words only, any digit, runs of spaces, line breaks, or rearranging parts of each match. In this mode punctuation has special meanings, and the same search for e.g. finds 3 matches, because each period now means any character and so eggs matches too. To search for a literal period, bracket or other special character in regex mode, put a backslash before it, as in e\.g\.
A quick safety check in either mode is the Matches found figure. If it is much higher than you expected, the search is probably matching inside longer words; if it is 0, check the capitalization setting and look for a stray space at the end of the Find box.
How to get your result
- 1
Paste the text you want to edit into the Your text box.
- 2
Type the word, phrase or pattern in Find, and what should take its place in Replace with. Leave Replace with empty to delete the matches.
- 3
Tick Match letter case if cat and Cat should be treated as different.
- 4
Tick Treat 'Find' as a regular expression to use patterns such as \bcat\b or \s+.
- 5
Check Matches found, then copy the Result or download it as replaced.txt.