Hi guys I need the best available preg_match regular expression to validate email addresses. The expressions I've found failed with one of the following emails: > someemail/r@somedomain.com etc. Thanks!
Why not just use the filter function http://uk2.php.net/manual/en/filter.examples.validation.php also, e-mail addresses shouldn't have /r in them
Give filter_var() a shot: function is_email( $email ) { return FALSE !== filter_var( $email, FILTER_VALIDATE_EMAIL ); } PHP: Of your three examples, the first two are invalid, but the third is valid, as forward slashes are allowed in the local portion. http://en.wikipedia.org/wiki/E-mail_address#RFC_specification