iOS 电话号码检测正则表达式
- (BOOL)isMobileNumber:(NSString *)mobileNum {
NSString * MOBILE = @"^((13[0-9])|(14[^4,\\D])|(15[^4,\\D])|(18[0-9]))\\d{8}$|^1(7[0-9])\\d{8}$";
NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", MOBILE];
if ([regextestmobile evaluateWithObject:mobileNum] == YES){
return YES; }
else{
return NO;
}
}