in reply to Regex for e-mail contacts name

Instead of trying to find the e-mail addresses, another approach is to take out the stuff that isn't one. Looks like the stuff between double quotes.

The regex matches any word character, ".", "," or space within double quotes and deletes that.

#!/usr/bin/perl -w use strict; my $string = 'sean@gmail.com, "richard J. Smith, M.D." <richard@gmail. +com>, "john" <john@gmail.com>, <jack@gmail.com>'; $string =~ s/\"[\w .,]+"//g; print $string; #sean@gmail.com, <richard@gmail.com>, <john@gmail.com>, <jack@gmail. +com>