//Regex for Validating EmailID
-(BOOL) validateEmailIDfromString : (NSString *) s {
NSString * emailregexString = @"\\b([a-zA-Z0-9%_.+\\-]+)@([a-zA-Z0-9.\\-]+?\\.[a-zA-Z]{2,3})\\b" ;
NSPredicate *regexText = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",emailregexString] ;
return ([regexText evaluateWithObject:s]);
}
if(![self validateEmailIDfromString:txtLogin]) {
// Invalid email ID
}
No comments:
Post a Comment