1 changed files with 10 additions and 0 deletions
@ -0,0 +1,10 @@ |
|||
package rest |
|||
|
|||
import ( |
|||
"regexp" |
|||
) |
|||
|
|||
func ValidateEmail(email string) bool { |
|||
emailRegexp := 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])?)*$") |
|||
return emailRegexp.MatchString(email) |
|||
} |
|||
Loading…
Reference in new issue