diff --git a/app/lea/Util.go b/app/lea/Util.go index 503d46b..b8a2b21 100644 --- a/app/lea/Util.go +++ b/app/lea/Util.go @@ -265,7 +265,7 @@ func IsEmail(email string) bool { if email == "" { return false; } - ok, _ := regexp.MatchString(`^([a-zA-Z0-9]+[_|\_|\.|\-]?)*[a-z\-A-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|\-]?)*[a-zA-Z0-9\-]+\.[0-9a-zA-Z]{2,3}$`, email) + ok, _ := regexp.MatchString(`^([a-zA-Z0-9]+[_|\_|\.|\-]?)*[_a-z\-A-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|\-]?)*[a-zA-Z0-9\-]+\.[0-9a-zA-Z]{2,6}$`, email) return ok } diff --git a/app/views/home/register.html b/app/views/home/register.html index f05e74a..19e29da 100644 --- a/app/views/home/register.html +++ b/app/views/home/register.html @@ -72,7 +72,7 @@ $(function() { showMsg("{{msg . "inputEmail"}}", "email"); return; } else { - var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[0-9a-zA-Z]{2,3}$/; + var myreg = /^([a-zA-Z0-9]+[_|\_|\.|\-]?)*[a-zA-Z0-9\-_]+@([a-zA-Z0-9\-]+[_|\_|\.|\-]?)*[a-zA-Z0-9\-]+\.[0-9a-zA-Z]{2,6}$/; if(!myreg.test(email)) { showMsg("{{msg . "wrongEmail"}}", "email"); return; @@ -117,4 +117,4 @@ $(function() { }); - \ No newline at end of file +