Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alist-org
GitHub Repository: alist-org/alist
Path: blob/main/pkg/utils/email.go
1560 views
1
package utils
2
3
import "regexp"
4
5
func IsEmailFormat(email string) bool {
6
pattern := `^[0-9a-z][_.0-9a-z-]{0,31}@([0-9a-z][0-9a-z-]{0,30}[0-9a-z]\.){1,4}[a-z]{2,4}$`
7
reg := regexp.MustCompile(pattern)
8
return reg.MatchString(email)
9
}
10
11