Skip to content

Instantly share code, notes, and snippets.

@Arathi
Last active July 8, 2020 08:13
Show Gist options
  • Save Arathi/05fc6137c61e59e701efbac9150b3231 to your computer and use it in GitHub Desktop.
Save Arathi/05fc6137c61e59e701efbac9150b3231 to your computer and use it in GitHub Desktop.
中国内地移动终端通信号段规则

中国内地移动终端通信号段规则

正则表达式

移动

^((13[5-9]|14[78]|15[012789]|165|17[28]|18[23478]|19[578])\d{8})|((134[0-8]|144[01]|170[356])\d{7})$

联通

^((13[012]|14[56]|15[56]|16[67]|17[156]|18[56]|196)\d{8})|(170[4789]\d{7})$

电信

^((133|149|153|162|17[37]|18[019]|19[0139])\d{8})|((1349|1410|170[012])\d{7})|(1740[0-5]\d{6})$

全网

^((13|18)\d{9}|(14[5-9]|15[0-35-9]|16[2567]|17[0-35-8]|19[0135-9])\d{8}|(1410|144[01])\d{7}|(1740[0-5])\d{6})$

测试数据

## 移动常规
13401234567
13501234567
13601234567
13701234567
13801234567
13901234567
14401234567
14411234567
14701234567
14800234567
15001234567
15101234567
15201234567
15701234567
15801234567
15901234567
17201234567
17801234567
18201234567
18301234567
18401234567
18701234567
18801234567
19501234567
19701234567
19801234567

## 移动虚拟
16501234567
17031234567
17051234567
17061234567

## 移动例外
### 1349属于电信和北京船舶的卫星电话
13491234567
### 144号段只用了1440和1441
14421234567
14491234567

## 联通常规
13001234567
13101234567
13201234567
14501234567
14601234567
15501234567
15601234567
16601234567
17101234567
17501234567
17601234567
18501234567
18601234567
19601234567

## 联通虚拟
16701234567
17041234567
17071234567
17081234567
17091234567
17101234567

## 电信常规
13301234567
13491234567
14101234567
14901234567
15301234567
17301234567
17400234567
17405234567
17701234567
18001234567
18101234567
18901234567
19001234567
19101234567
19301234567
19901234567

## 电信虚拟
16201234567
17001234567
17011234567
17021234567

## 电信例外
### 141号段第四位只能是0
14111234567
### 1740号段第五位只能是0-5
17406234567

## 广电
19201234567

## 无效号段
14001234567
14201234567
14301234567
15401234567
16001234567
16101234567
16301234567
16401234567
16801234567
16901234567
17901234567
19401234567

参考资料

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment