Created
October 25, 2011 07:48
-
-
Save wheresalice/1311754 to your computer and use it in GitHub Desktop.
Replacement Drupal function for email validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function valid_email_address($mail) { | |
return (bool)filter_var($mail,FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>"/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/"))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment