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)) Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.