Posted By

vaishnavi on 12/09/10


Tagged

email


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

vaishnavi
sag333ar
terababy
Tintenklecks
cnathan


email address validation in objective c


 / Published in: Objective C
 

  1. - (BOOL) validateEmail: (NSString *) emailstring {
  2. NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
  3. NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
  4.  
  5. return [emailTest evaluateWithObject:emailstring];
  6. }

Report this snippet  

You need to login to post a comment.