One additional point to consider ... while Email::Valid as pointed out by kschwab and azatoth is by far the better method by which to validate email addresses (compared to a single regex), this will not negate the possibility of bounced mail coming back to your mail server - This moduile performs a check to see if the email address appears to be valid, including RFC822 checks and DNS MX record checks, but does not guarentee the validity of the email address with regards to delivery. It is still quite possible for someone to enter a 'bogus' email address that passes RFC and DNS checks, but cannot me delivered, whether due to mailer or remote configuration errors. eg. quota limits, unknown user, etc.
 
This is something to keep in mind where sending mail from web applications and can be curtailed through judicious use of Email::Valid (with mxcheck enabled) and use of valid From: header fields in your application to direct bounced mail (on one of my boxes I have a mailbox directed to /dev/null specifically for such bounce messages).
 
Update: I should also point out that this aspect of mail delivery and handling of bounced mail is true of ANY email validation system (short of the successful delivery and receipt of a test email message) - Email::Valid however offers the most comprehensive and complete means (that I know of) of validating an email address prior to mail delivery.
 

 
Ooohhh, Rob no beer function well without!

In reply to Re: E-mail Regular Expression by rob_au
in thread E-mail Regular Expression by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.