Map Extract
Free tool

Find and replace text, with regular expressions

Paste your text, type what to find and what to put in its place, and the result appears below with a count of replacements. Switch on regular expressions to change patterns, not just fixed words.

Runs in your browser. Nothing you enter is uploaded.

Replacing text

  1. 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.

  2. 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.

  3. Narrow the match

    Match case treats Ltd and LTD as different. Whole words stops a match inside a longer word.

  4. 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 $1 for the first group, $2 for 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.

Input
Find:    \b0(\d{4}) (\d{6})\b
Replace: +44 $1 $2
Regular expression on

Call 01632 960123 or 01632 960456
Mobile 07700 900321
Result
3 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.

JobFindReplace with
Make Ltd, LTD and ltd. consistent\bltd\.?Ltd
Strip https:// and www. from linkshttps?://(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

Top