James Kelty wrote: > > I know that this is a common request, but I have a question about > parsing an email box. I have a UW IMAP box, and I am trying to extract > all the emails where the line starts with From: blah blah. Now, getting > those lines isn't the issue, but since each email is a little different, > I am having a problem. Given this list, how would I extract JUST the > email address? > > From: "James Kelty" <[EMAIL PROTECTED]> > From: [EMAIL PROTECTED] > From: <[EMAIL PROTECTED]" > > There are three types that I have seen, and I am having the worst time > trying to come up with a regex to extract just the address. Can someone > help with an idea or two? Thanks!
It looks like you could use one of these modules: http://search.cpan.org/author/MARKOV/MailTools-1.58/Mail/Address.pm http://search.cpan.org/author/PDWARREN/Mail-RFC822-Address-0.3/Address.pm http://search.cpan.org/author/ABIGAIL/RFC_RFC822_Address-1.5/Address.pm John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]