- (BOOL)checkPassword:(NSString *) password
{
NSString *pattern = @"^(?![0-9]+$)(?![a-zA-Z]+$)[a-zA-Z0-9]{6,20}";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES%@",pattern];
BOOL isMatch = [pred evaluateWithObject:password];
return isMatch;
}
网友评论