字母数字混合密码校验

- (BOOL)checkPassword:(NSString *) password{   

      NSString *pattern = @"^(?![0-9]+$)(?![a-zA-Z]+$)[a-zA-Z0-9]{6,15}";  

     NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES%@",pattern];   

      BOOL isMatch = [pred evaluateWithObject:password];   

       return isMatch;

}

你可能感兴趣的:(字母数字混合密码校验)