Replacing text
Paste the text
A list, a CSV column, an email template or a block of web copy. Every match in the whole text is replaced, not only the first.
Fill in Find and Replace with
An empty Replace with box deletes whatever is found. A count of how many changes were made appears just over the result box.
Narrow the match
Match case treats Ltd and LTD as different. Whole words stops a match inside a longer word.
Use a pattern if needed
Tick Regular expression to search with a pattern. Anything a bracketed part of the pattern captured comes back in the replacement as
$1for the first group,$2for the second. A broken pattern shows an error rather than a wrong result.
Example: putting UK numbers into international format
A list exported for a calling tool has numbers written as 01632 960123, but the dialler wants +44 and no leading zero. The pattern finds a 0 followed by four digits, a space and six digits, and keeps both groups of digits.
Three numbers are rewritten in one go. The pattern relies on the spacing in this list; numbers written another way, such as 0161 496 0000, need their own pattern or a phone formatter.
Find: \b0(\d{4}) (\d{6})\b
Replace: +44 $1 $2
Regular expression on
Call 01632 960123 or 01632 960456
Mobile 07700 9003213 replacements Call +44 1632 960123 or +44 1632 960456 Mobile +44 7700 900321
Patterns that help with lead lists
Each of these needs Regular expression ticked. Match case is off unless stated.
| Job | Find | Replace with |
|---|---|---|
| Make Ltd, LTD and ltd. consistent | \bltd\.? | Ltd |
| Strip https:// and www. from links | https?://(www\.)? | (leave empty) |
| Remove a slash at the end of each line | /(?=\n|$) | (leave empty) |
| Swap "Surname, First" to "First Surname" | (\w+), (\w+) | $2 $1 |
| Turn tabs into commas | \t | , |
Questions people ask
How do I find and replace across many lines at once?
Paste all the lines into the box. Every match anywhere in the text is replaced in one pass, and the count tells you how many changed. In this tool ^ and $ anchor to the very beginning and finish of everything you pasted, so to target line ends use a lookahead such as (?=\n|$), as in the table above.
What does $1 mean in the replacement?
It stands for whatever the first pair of brackets in your pattern matched. In the phone example, (\d{4}) captured 1632, so +44 $1 puts +44 in front of those same digits. $2 is the second bracketed group, and so on.
Can I undo a replacement?
Your original text stays in the top box untouched; only the result below changes. Clear or edit the Find box to see the original again. Nothing is changed in any file until you copy the result and paste it somewhere yourself.
Where your data goes
Find, replace and pattern matching all run locally in the page. Your text and patterns are not sent to a server.
Checked against the tool on