

What is the most correct way to validate an e-mail address? - phwd
http://www.quora.com/What-is-the-most-correct-way-to-validate-an-e-mail-address

======
jolan
PHP makes it pretty easy:

    
    
      if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
        $emailvalid = 1;
      }

~~~
prodigal_erik
<http://bugs.php.net/bug.php?id=43402> claims PHP is using an unmaintained
regexp that gives incorrect results.

------
presidentender
I used one of those "close" regexes last time I needed to do this in C#. I
believe I went with

    
    
        ^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.(?:[A-Z]{2,4}|museum)$

~~~
mike-cardwell
bill.o'reilly@example.com

------
mike-cardwell
Do not roll your own. Use a library. You will miss stuff.

