From 711e6b3d17b0dd991585af390f4b0e781ca27552 Mon Sep 17 00:00:00 2001 From: lealife Date: Sat, 10 Oct 2015 15:02:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E9=82=AE=E7=AE=B1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=A4=9A=E4=B8=AA"=5F",=20=E5=A6=82=20a=5F=5Fa@a.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lea/Util.go | 2 +- app/views/home/register.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 +