[Fix] 🐛 Fix Regexp Pattern to Support subdomain Email #15

This commit is contained in:
Harry-zklcdc 2025-02-24 23:38:04 +08:00
parent 13bd350274
commit 81b52e80b5

View File

@ -5,7 +5,7 @@ import (
) )
func EmailFormat(email string) bool { func EmailFormat(email string) bool {
pattern := `^\w+(-+.\w+)*@\w+(-.\w+)*.\w+(-.\w+)*$` pattern := `\w[-\w.+]*@([-A-Za-z0-9]+\.)+[A-Za-z]{2,14}`
match, err := regexp.MatchString(pattern, email) match, err := regexp.MatchString(pattern, email)
if err != nil { if err != nil {
return false return false