+(BOOL)checkPassword:(NSString*)pass { NSString *regex = @"^[A-Za-z0-9]+$"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@ AND SELF.length > 3 AND SELF.length < 16",regex]; return [predicate evaluateWithObject:pass]; }原文链接:https://www.f2er.com/regex/360633.html