in reply to How to validate E-mail addresses

To do it correctly, it is not a simple regexp. use the Email::Valid module from CPAN.

use Email::Valid; print (Email::Valid->address('maurice@hevanet.com') ? 'yes' : 'no');

_______________
DamnDirtyApe
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
            --Friedrich Nietzsche

Replies are listed 'Best First'.
Re: E-mail
by hacker (Priest) on Aug 04, 2002 at 20:05 UTC
    As I'm sure you've found out, this will fail on non-RFC compliant addresses that are deliverable (as detailed in recipe 6.19 of The Perl Cookbook), as well as those people from AOL who don't know their own email address (joe@aol, because everyone uses AOL, right?)

    Also, with Email::Valid, you should enable the -mxcheck option and do some SMTP afterwards to verify that what you found, has an actual account on the other side.