mirror of
https://github.com/HChaZZY/alist.git
synced 2025-12-06 11:03:49 +08:00
9
pkg/utils/email.go
Normal file
9
pkg/utils/email.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package utils
|
||||
|
||||
import "regexp"
|
||||
|
||||
func IsEmailFormat(email string) bool {
|
||||
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}$`
|
||||
reg := regexp.MustCompile(pattern)
|
||||
return reg.MatchString(email)
|
||||
}
|
||||
Reference in New Issue
Block a user