added mail functionality

This commit is contained in:
$(pass /github/name)
2024-07-03 12:35:41 +02:00
parent 6d34d99835
commit 96f008d67e
10 changed files with 132 additions and 24 deletions

View File

@@ -3,8 +3,7 @@ package utils
import "regexp"
func IsEmailValid(email string) bool {
regex := `^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,}$`
re := regexp.MustCompile(regex)
return re.MatchString(email)
regex := `^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,}$`
re := regexp.MustCompile(regex)
return re.MatchString(email)
}