func validateEmail(emailAddress:String)->Bool{
let emailRegularExpression = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
let emailValidationPredicate = NSPredicate(format: "SELF MATCHES %@", emailRegularExpression)
return emailValidationPredicate.evaluate(with: emailAddress)
}
No comments:
Post a Comment