diff --git a/src/validators.js b/src/validators.js index 273b6c02..eac85128 100644 --- a/src/validators.js +++ b/src/validators.js @@ -106,7 +106,7 @@ Form.validators = (function() { options = _.extend({ type: 'email', message: this.errMessages.email, - regexp: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i + regexp: /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i }, options); return validators.regexp(options); diff --git a/test/validators.js b/test/validators.js index 76bea8da..0144f421 100644 --- a/test/validators.js +++ b/test/validators.js @@ -274,6 +274,8 @@ equal(fn('email@domain-one.com'), undefined) equal(fn('_______@domain.com'), undefined) equal(fn('email@domain.name'), undefined) + equal(fn('email@domain.name.name.name.name'), undefined) + equal(fn('email.john+smith@domain.name'), undefined) }) })();