Skip to content

Instantly share code, notes, and snippets.

@onevcat
Created August 28, 2012 11:22
Show Gist options
  • Select an option

  • Save onevcat/3497341 to your computer and use it in GitHub Desktop.

Select an option

Save onevcat/3497341 to your computer and use it in GitHub Desktop.
Email Validate
-(BOOL)isValidateEmail:(NSString *)email {
NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
return [emailTest evaluateWithObject:email];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment