这次给大家带来验证国内手机号与座机号的正则表达式,验证国内手机号与座机号的正则表达式的注意事项有哪些,下面就是实战案例,一起来看一下。
验证手机号:^((13[0-9])|(14[7])|(15[^4,\\D])|(18[0,0-9])|(17[0,0-9]))\\d{8}$ 验证座机和手机号:@"^(0(10|2[0-5789]|3\\d{2}|4\\d{2}|5\\d{2}|6\\d{2}|7\\d{2}|8\\d{2}|9\\d{2})\\d{7,8}$)|(0(10|2[0-5789]|3\\d{2}|4\\d{2}|5\\d{2}|6\\d{2}|7\\d{2}|8\\d{2}|9\\d{2})-\\d{7,8}$)|(\\d{7,8}$)|(((13[0-9])|(14[7])|(15[^4,\\D])|(18[0,0-9])|(17[0,0-9]))\\d{8}$) (目前座机不支持分机号)
相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!
推荐阅读:
The above is the detailed content of Regular expression to verify domestic mobile phone number and landline number. For more information, please follow other related articles on the PHP Chinese website!