注册邮箱支持多个"_", 如 a__a@a.com
This commit is contained in:
@ -265,7 +265,7 @@ func IsEmail(email string) bool {
|
|||||||
if email == "" {
|
if email == "" {
|
||||||
return false;
|
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
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ $(function() {
|
|||||||
showMsg("{{msg . "inputEmail"}}", "email");
|
showMsg("{{msg . "inputEmail"}}", "email");
|
||||||
return;
|
return;
|
||||||
} else {
|
} 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)) {
|
if(!myreg.test(email)) {
|
||||||
showMsg("{{msg . "wrongEmail"}}", "email");
|
showMsg("{{msg . "wrongEmail"}}", "email");
|
||||||
return;
|
return;
|
||||||
@ -117,4 +117,4 @@ $(function() {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user