//判断密码6-16位
+ (BOOL)validatePassword:(NSString *)password{
    
    NSString *Regex = @"^[a-zA-Z0-9]{5,16}$";
    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", Regex];
    
    return [emailTest evaluateWithObject:password];
}

//判断手机号11位
+ (BOOL)validateMobile:(NSString *)mobileNum{
    
    NSString *MOBILE = @"^1(3[0-9]|5[0-35-9]|8[025-9])\\d{8}$";
    NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",MOBILE];
    
    return [regextestmobile evaluateWithObject:mobileNum];
}

 

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2021-08-16
  • 2021-12-10
  • 2021-11-04
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案