Regexp::Common::Email::Address - Returns a pattern for Email Addresses
use Regexp::Common qw[Email::Address]; use Email::Address; while (<>) { my (@found) = /($RE{Email}{Address})/g; my (@addrs) = map $_->address, Email::Address->parse("@found"); print "X-Addresses: ", join(", ", @addrs), "\n"; }
$RE{Email}{Address}
Provides a regex to match email addresses as defined by RFC 2822. Under {-keep}, the entire match is kept as $1. If you want to parse that further then pass it to Email::Address->parse(). Don't worry, it's fast.
{-keep}
$1
Email::Address->parse()
Email::Address, Regexp::Common, perl.
Casey West, <casey@geeknest.com>.
Copyright (c) 2005 Casey West. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Regexp::Common::Email::Address, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Regexp::Common::Email::Address
CPAN shell
perl -MCPAN -e shell install Regexp::Common::Email::Address
For more information on module installation, please visit the detailed CPAN module installation guide.