You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// CountUniqueCharacters counts the unique characters in a string
func CountUniqueCharacters(str string) int {
counter := make(map[int32]int)
for _, value := range str {
counter[value]++
}
return len(counter)
}
// VerifyEmail verify if the string is actually an email
func VerifyEmail(email string) error {
re := regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")