Add tool dir.

This commit is contained in:
zicla
2019-04-26 03:08:22 +08:00
parent aed1ee2001
commit c5de9ce9eb
28 changed files with 23 additions and 22 deletions

View File

@ -0,0 +1,10 @@
package util
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)
}