mirror of
https://github.com/XShengTech/MEGREZ.git
synced 2026-01-14 00:57:17 +08:00
15 lines
234 B
Go
15 lines
234 B
Go
package utils
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
func EmailFormat(email string) bool {
|
|
pattern := `\w[-\w.+]*@([-A-Za-z0-9]+\.)+[A-Za-z]{2,14}`
|
|
match, err := regexp.MatchString(pattern, email)
|
|
if err != nil {
|
|
return false
|
|
}
|
|
return match
|
|
}
|