/ Published in: PHP
URL: email_validator
Definitivo. Errore bassissimo.
Expand |
Embed | Plain Text
$pattern = "/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i"; echo "ok";
Comments
Subscribe to comments
You need to login to post a comment.

Please don't use this for email validation. It fails for so many valid email addresses. Take, for example, a google address with a tag:
Its a perfect valid email address but the regex fails it. A regex CAN'T properly validate an email according to the RFC, and if you really want to learn how to do it properly, read:
http://www.dominicsayers.com/isemail/
Please don't use this for email validation. It fails for so many valid email addresses. Take, for example, a google address with a tag:
Its a perfect valid email address but the regex fails it. A regex CAN'T properly validate an email according to the RFC, and if you really want to learn how to do it properly, read:
http://www.dominicsayers.com/isemail/
maybe you are right, but i need a validator very strict. if it fails for a valid email, the user can always contact me and convince me his email address is valid!