首页 > 代码库 > Objective C中E-mail地址验证

Objective C中E-mail地址验证

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

 

Objective C中E-mail地址验证