Re: Re: Quick email address check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I have used this to good effect

 function isEmail($email)
 {
     if
 (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}",$email))
  {
          return TRUE;
  } else {
          return FALSE;
     }
 }//end function


I often have a '+' in my email address (which is perfectly valid) and
it really annoys me when a site refuses to accept it.

Didn't notice this before but that regex ignores valid TLD's too like .museum, .travel .. Probably not that common but certainly valid.

http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux