package validator
import "regexp"
const (
Email string = "^[\\w\\.\\d-_]+@[\\w\\.\\d-_]+\\.\\w{2,4}$"
Login string = "^[.\\-\\a-zA-Z0-9]+$"
)
var (
rxEmail = regexp.MustCompile(Email)
rxLogin = regexp.MustCompile(Login)
)
func IsEmail(str string) bool {
return rxEmail.MatchString(str)
}
func IsLogin(str string) bool {
return rxLogin.MatchString(str)
}