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";
}
Provides a regex to match email addresses as defined by \s-1RFC\s0 2822. Under \*(C`{-keep}\*(C', the entire match is kept as $1. If you want to parse that further then pass it to \*(C`Email::Address->parse()\*(C'. Don't worry, it's fast.
Email::Address, Regexp::Common, perl.
Casey West, <[email protected]>.
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.