Revision: 72871
Updated Code
at March 14, 2018 17:35 by plasticbottle
Updated Code
function is_email_valid($email) { return (preg_match('/^[a-zA-z0-9._'+]+@[a-zA-z0-9]+\.([a-z0-9-]{2,4}|[a-z0-9]{2,}+\.[a-z0-9]{2,4})$/', $email) > 0) ? true : false; }
Revision: 72870
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at March 14, 2018 17:32 by plasticbottle
Initial Code
function is_email_valid($email) { return (preg_match('^[a-zA-z0-9._'+]+@[a-zA-z0-9]+\.([a-z0-9-]{2,4}|[a-z0-9]{2,}+\.[a-z0-9]{2,4})$', $email) > 0) ? true : false; }
Initial URL
Initial Description
It should work for domains like @something.co.uk note that regex will never really be able to match 100% of e-mail addresses without allowing some false positives
Initial Title
PHP regex e-mail validation
Initial Tags
regex
Initial Language
PHP