AV1611 Posted April 18, 2008 Share Posted April 18, 2008 can anyone improve this? aaa@bbb is valid... if( !preg_match( "/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $email)) Link to comment https://forums.phpfreaks.com/topic/101649-email-validation/ Share on other sites More sharing options...
bruack Posted April 18, 2008 Share Posted April 18, 2008 if (!preg_match('/^[-_a-z0-9\'+*$^&%=~!?{}]++(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*+@(??![-.])[-a-z0-9.]+(?<![-.])\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?$/iD', $email)) That should do the trick. Also, there's an ongoing topic already: http://www.phpfreaks.com/forums/index.php/topic,192839.0.html Link to comment https://forums.phpfreaks.com/topic/101649-email-validation/#findComment-520068 Share on other sites More sharing options...
AV1611 Posted April 18, 2008 Author Share Posted April 18, 2008 if(!preg_match("/^[-_a-z0-9\'+*$^&%=~!?{}]++(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*+@(??![-.])[-a-z0-9.]+(?<![-.])\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?$/iD", $email)) LOL someone else just posted the exact same question thanks. Link to comment https://forums.phpfreaks.com/topic/101649-email-validation/#findComment-520069 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.