- (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;
}
网友评论