[aur-dev] [PATCH 2/5] use valid_email() from codeigniter's email helper

Cédric Girard girard.cedric at gmail.com
Wed Jun 22 16:11:28 EDT 2011


On Wed, Jun 22, 2011 at 9:36 PM, Florian Pritz <bluewind at xinu.at> wrote:

>  +       return ( !
> preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix",
> $addy)) ? FALSE : TRUE;
>

Some legitimate email address will not be matched by your regexp.

Better use built-in PHP functions:

return filter_var($addy,FILTER_VALIDATE_EMAIL);

-- 
Cédric Girard


More information about the aur-dev mailing list