iOS 判断是否为邮箱

、、、

+ (BOOL)isEmail:(NSString*)email

{

NSString*emailRegex =@"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";

NSPredicate*emailTest = [NSPredicatepredicateWithFormat:@"SELF MATCHES %@", emailRegex];

return[emailTestevaluateWithObject:email];

}

、、、

你可能感兴趣的:(iOS 判断是否为邮箱)