regular expression compatible to RFC 5322
some TLDs (ie aero, museum) and lots of gTLDs have more than three characters extension, the current regex cutoffs the usage of this domains.
@@ -667,7 +667,7 @@ function showHidePassword(element, inputId) {
function emailValidator(name) {
var errorMsg = "";
- var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
+ var emailPattern = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (name == "") {
errorMsg = "null";
} else if (!name.match(new RegExp(emailPattern))) {
