I recommend Email::Address or Regexp::Common::Email::Address. I'd also encourage you to look into Mail::Message::Field::Full, Data::Validate::Email, Email::AddressParser or maybe Email::Valid as previously mentioned. Those are maintained for us all to use, and get updated whenever they need to be. It sure beats everyone doing something different. I can only recommend two specifically, because I can't recall having used the others.
If you're having issues getting modules from CPAN (or PPM), please make a new post regarding those problems.
If you're really needing to have a regex in your own code rather than using a module, you can get the regex for a valid email from Email::Address or Regexp::Common::Email::Address. I'd recommend against doing it that way, because you might need to update manually again in the future. CPAN is your friend, and it makes updating to newer versions of modules pretty easy.
You might want to note that Email::Valid uses Mail::Address, and the author of Mail::Address states that it only covers 95% of valid cases. The author of that recommends Mail::Message::Field::Full. Email::Address doesn't have this particular issue, as it is designed to the RFC 2822 spec. That's why I mildly recommend against Email::Valid and Mail::Address.
In reply to Re: checking email syntax
by mr_mischief
in thread checking email syntax
by powerhouse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |