iOS手机号判断方法

来源:互联网 发布:如何使用风险矩阵表 编辑:程序博客网 时间:2024/05/23 11:55
// 正则判断手机号码地址格式- (BOOL)isMobileNumber:(NSString *)mobileNum {//    电信号段:133/153/180/181/189/177//    联通号段:130/131/132/155/156/185/186/145/176//    移动号段:134/135/136/137/138/139/150/151/152/157/158/159/182/183/184/187/188/147/178//    虚拟运营商:170NSString *MOBILE = @"^1(3[0-9]|4[57]|5[0-35-9]|8[0-9]|7[06-8])\\d{8}$";NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", MOBILE];return [regextestmobile evaluateWithObject:mobileNum];}
0 0
原创粉丝点击