Created
January 25, 2023 09:18
-
-
Save sourleangchhean168/c8a2c339b982b97b15ca0fd75321b119 to your computer and use it in GitHub Desktop.
Check Valid Email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func isValidEmail(email: String) -> Bool { | |
let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}" | |
let emailPred = NSPredicate(format:"SELF MATCHES %@", emailRegEx) | |
return emailPred.evaluate(with: email) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment