https://en.wikipedia.org/wiki/Email_address
I think there should° be a module dedicated to parse a list of email addresses.
Doing this manually smells like trying to parse HTML with a regex.
°) Yep, see Email::Address on CPAN (unexpected name ;-)
my @addrs = Email::Address->parse( q[me@local, Casey <me@local>, "Casey" <me@local> (West)] );
and from the description
ACHTUNG! Email isn't easy (if even possible) to parse with a regex, at least if you're on a perl prior to 5.10.0. Providing regular expressions for use by other programs isn't a great idea,
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
In reply to Re^3: getting headers from essage (Email::Address)
by LanX
in thread getting headers from essage
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |