Skip to content

Commit

Permalink
fix(formats): email regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter John committed Jul 31, 2015
1 parent ca77421 commit f4bc33c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/themis.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@ var Utils = {
if (typeof email !== "string") {
return true;
}
// use regex from owasp: https://www.owasp.org/index.php/OWASP_Validation_Regex_Repository
return /^[a-zA-Z0-9+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$/.test(email);
// http://emailregex.com/
return /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(email);
},
"hostname": function (hostname) {
if (typeof hostname !== "string") {
Expand Down

0 comments on commit f4bc33c

Please sign in to comment.