/**
* 检测用户输入密码是否以字母开头,6-18位数字和字母组合
*正则匹配用户密码6-18位数字和字母组合
* @param pattern 传入需要检测的字符串
*
* @return 返回检测结果 是或者不是
*/
+(BOOL)detectionIsPasswordQualified:(NSString *)patternStr{
NSString *pattern = @"^(?![0-9]+$)(?![a-zA-Z]+$)[a-zA-Z0-9]{6,18}";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", pattern];
BOOL isMatch = [pred evaluateWithObject:patternStr];
return isMatch;
}