我国大陆地区的手机号正则匹配
-- hive sql 测试通过
select phone_num RLIKE "^(\\+?86)?((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|161|166|198|199|(147))\\d{8}$"
在线正则测试
http://tool.oschina.net/regex#
测试的时候,sql 中的正则的双需要改为:
-- 在线测试
^(\+?86)?((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|161|166|198|199|(147))\d{8}$
我的博客即将同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=3ckgexxns8g0o