Skip to content

Commit

Permalink
fix(registrar): allow for uppercase in top level domain of email
Browse files Browse the repository at this point in the history
- There are many regexes for domain validation floating around
that require the top level domain to be lowercase, however I have
not found any reason for it to be so and most email validators
accept it uppercase aswell
  • Loading branch information
kofzera committed Nov 12, 2024
1 parent 1fe4768 commit 70ac796
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ public native static boolean isValidEmail(String email) /*-{
//var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
//var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
//return !reg1.test(email) && reg2.test(email);
var reg4 = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-z]{2,}$/;
var reg4 = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
return reg4.test(email);
}-*/;

Expand Down

0 comments on commit 70ac796

Please sign in to comment.