api/pkg/utils/isEmail.go

9 lines
187 B
Go
Raw Normal View History

2025-07-06 22:21:32 +03:00
package utils
import "regexp"
func (u *Utils) IsEmail(email string) bool {
re := regexp.MustCompile(`^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`)
return re.MatchString(email)
}