//手机号检索
#define IS_Number(senderString)({ NSString *pattern = @"^((13[0-9])|(147)|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"; \
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", pattern]; \
([pred evaluateWithObject:senderString])? YES : NO; \
})
//密码检索
#define IS_Password(senderString)({ NSString *regex = @"^(?![0-9]+$)(?![a-zA-Z]+$)(?![`~!@#$%^&*()+=|{}_':;',\\\\[\\\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?])([0-9A-Za-z]|[`~!@#$%^&*()+=|{}_':;',\\\\[\\\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]){6,20}$"; \
NSPredicate * pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; \
([pred evaluateWithObject:senderString])? YES : NO; \
})
//6位数字检索
#define IS_Digital(senderString)({ NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"^[0-9]{6}+$" options:NSRegularExpressionCaseInsensitive error:nil]; \
NSInteger numberOfMatches = [regex numberOfMatchesInString:senderString options:0 range:NSMakeRange(0, [senderString length])];\
numberOfMatches > 0 ? YES : NO; \
})
//昵称检索
#define IS_Name(senderString)({ NSString *regex = @"^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]{1,13}+$"; \
NSPredicate * pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; \
([pred evaluateWithObject:senderString])? YES : NO; \
})