Skip to content

Commit b5f62eb

Browse files
authoredMay 5, 2020
Merge pull request #29 from VincentSit/patch-1441
Add support for 1441 prefix.
2 parents 4ddaa27 + 05c631c commit b5f62eb

File tree

4 files changed

+48
-41
lines changed

4 files changed

+48
-41
lines changed
 

‎POSIX-CN.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,19 @@
2424
2525
这些转义字符并不是正则表达式所需要的。在您修改正则表达式的时候请多加小心。
2626
为了防止渲染出现错误,所有的正则表达式都需要在注释中写清转义之前的语句。
27+
2728
参见 https://help.github.com/articles/organizing-information-with-tables/#formatting-content-within-your-table
2829
-->
2930

3031
<!--
31-
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[01235-9][0-9]{2}|8[0-9]{3}|7([0-35-9][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[0-35-9][0-9]{2}|6[2567][0-9]{2}|4([14]0[0-9]{3}|[68][0-9]{4}|[579][0-9]{2}))[0-9]{6}$` |
32-
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[01235-9][0-9]\{2\}\|8[0-9]\{3\}\|7\([0-35-9][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[0-35-9][0-9]\{2\}\|6[2567][0-9]\{2\}\|4\([14]0[0-9]\{3\}\|[68][0-9]\{4\}\|[579][0-9]\{2\}\)\)[0-9]\{6\}$` |
32+
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[01235-9][0-9]{2}|8[0-9]{3}|7([0-35-9][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[0-35-9][0-9]{2}|6[2567][0-9]{2}|4((10|4[01])[0-9]{3}|[68][0-9]{4}|[579][0-9]{2}))[0-9]{6}$` |
33+
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[01235-9][0-9]\{2\}\|8[0-9]\{3\}\|7\([0-35-9][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[0-35-9][0-9]\{2\}\|6[2567][0-9]\{2\}\|4\((10|4[01])[0-9]\{3\}\|[68][0-9]\{4\}\|[579][0-9]\{2\}\)\)[0-9]\{6\}$`
3334
-->
3435

3536
| 命令 | 正则表达式 |
3637
| --- | --- |
37-
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[01235-9][0-9]{2}\|8[0-9]{3}\|7([0-35-9][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[0-35-9][0-9]{2}\|6[2567][0-9]{2}\|4([14]0[0-9]{3}\|[68][0-9]{4}\|[579][0-9]{2}))[0-9]{6}$` |
38-
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[01235-9][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([0-35-9][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[0-35-9][0-9]\{2\}\\|6[2567][0-9]\{2\}\\|4\([14]0[0-9]\{3\}\\|[68][0-9]\{4\}\\|[579][0-9]\{2\}\)\)[0-9]\{6\}$` |
38+
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[01235-9][0-9]{2}\|8[0-9]{3}\|7([0-35-9][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[0-35-9][0-9]{2}\|6[2567][0-9]{2}\|4((10\|4[01])[0-9]{3}\|[68][0-9]{4}\|[579][0-9]{2}))[0-9]{6}$` |
39+
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[01235-9][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([0-35-9][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[0-35-9][0-9]\{2\}\\|6[2567][0-9]\{2\}\\|4\(\(10\\|4[01]\)[0-9]\{3\}\\|[68][0-9]\{4\}\\|[579][0-9]\{2\}\)\)[0-9]\{6\}$` |
3940

4041
### 匹配所有支持短信功能的号码(手机卡 + 上网卡)
4142

@@ -84,8 +85,8 @@
8485

8586
| 命令 | 正则表达式 |
8687
| --- | --- |
87-
| GNU ERE | `^(+?86)?1(3[0-2]\|[578][56]\|66|96)[0-9]{8}$` |
88-
| GNU BRE | `^\(+\?86\)\?1\(3[0-2]\\|[578][56]\\|66|96\)[0-9]\{8\}$` |
88+
| GNU ERE | `^(+?86)?1(3[0-2]\|[578][56]\|66\|96)[0-9]{8}$` |
89+
| GNU BRE | `^\(+\?86\)\?1\(3[0-2]\\|[578][56]\\|66\\|96\)[0-9]\{8\}$` |
8990

9091
#### 匹配中国电信
9192

@@ -190,26 +191,26 @@
190191
#### 匹配所有
191192

192193
<!--
193-
| GNU ERE | `^(+?86)?14([14]0|[68][0-9])[0-9]{9}$` |
194-
| GNU BRE | `^\(+\?86\)\?14\([14]0\|[68][0-9]\)[0-9]\{9\}$` |
194+
| GNU ERE | `^(+?86)?14([14]0|41|[68][0-9])[0-9]{9}$` |
195+
| GNU BRE | `^\(+\?86\)\?14\([14]0\|41\|[68][0-9]\)[0-9]\{9\}$` |
195196
-->
196197

197198
| 命令 | 正则表达式 |
198199
| --- | --- |
199-
| GNU ERE | `^(+?86)?14([14]0\|[68][0-9])[0-9]{9}$` |
200-
| GNU BRE | `^\(+\?86\)\?14\([14]0\\|[68][0-9]\)[0-9]\{9\}$` |
200+
| GNU ERE | `^(+?86)?14([14]0\|41\|[68][0-9])[0-9]{9}$` |
201+
| GNU BRE | `^\(+\?86\)\?14\([14]0\\|41\\|[68][0-9]\)[0-9]\{9\}$` |
201202

202203
#### 匹配中国移动
203204

204205
<!--
205-
| GNU ERE | `^(+?86)?14(40|8[0-9])[0-9]{9}$` |
206-
| GNU BRE | `^\(+\?86\)\?14\(40\|8[0-9]\)[0-9]\{9\}$` |
206+
| GNU ERE | `^(+?86)?14(4[01]|8[0-9])[0-9]{9}$` |
207+
| GNU BRE | `^\(+\?86\)\?14\(4[01]\|8[0-9]\)[0-9]\{9\}$` |
207208
-->
208209

209210
| 命令 | 正则表达式 |
210211
| --- | --- |
211-
| GNU ERE | `^(+?86)?14(40\|8[0-9])[0-9]{9}$` |
212-
| GNU BRE | `^\(+\?86\)\?14\(40\\|8[0-9]\)[0-9]\{9\}$` |
212+
| GNU ERE | `^(+?86)?14(4[01]\|8[0-9])[0-9]{9}$` |
213+
| GNU BRE | `^\(+\?86\)\?14\(4[01]\\|8[0-9]\)[0-9]\{9\}$` |
213214

214215
#### 匹配中国联通
215216

‎POSIX.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt
3131
-->
3232

3333
<!--
34-
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[01235-9][0-9]{2}|8[0-9]{3}|7([0-35-9][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[0-35-9][0-9]{2}|6[2567][0-9]{2}|4([14]0[0-9]{3}|[68][0-9]{4}|[579][0-9]{2}))[0-9]{6}$` |
35-
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[01235-9][0-9]\{2\}\|8[0-9]\{3\}\|7\([0-35-9][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[0-35-9][0-9]\{2\}\|6[2567][0-9]\{2\}\|4\([14]0[0-9]\{3\}\|[68][0-9]\{4\}\|[579][0-9]\{2\}\)\)[0-9]\{6\}$` |
34+
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[01235-9][0-9]{2}|8[0-9]{3}|7([0-35-9][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[0-35-9][0-9]{2}|6[2567][0-9]{2}|4((10|4[01])[0-9]{3}|[68][0-9]{4}|[579][0-9]{2}))[0-9]{6}$` |
35+
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[01235-9][0-9]\{2\}\|8[0-9]\{3\}\|7\([0-35-9][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[0-35-9][0-9]\{2\}\|6[2567][0-9]\{2\}\|4\((10|4[01])[0-9]\{3\}\|[68][0-9]\{4\}\|[579][0-9]\{2\}\)\)[0-9]\{6\}$`
3636
-->
3737

3838
| Command | Regular Expression |
3939
| --- | --- |
40-
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[01235-9][0-9]{2}\|8[0-9]{3}\|7([0-35-9][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[0-35-9][0-9]{2}\|6[2567][0-9]{2}\|4([14]0[0-9]{3}\|[68][0-9]{4}\|[579][0-9]{2}))[0-9]{6}$` |
41-
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[01235-9][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([0-35-9][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[0-35-9][0-9]\{2\}\\|6[2567][0-9]\{2\}\\|4\([14]0[0-9]\{3\}\\|[68][0-9]\{4\}\\|[579][0-9]\{2\}\)\)[0-9]\{6\}$` |
40+
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[01235-9][0-9]{2}\|8[0-9]{3}\|7([0-35-9][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[0-35-9][0-9]{2}\|6[2567][0-9]{2}\|4((10\|4[01])[0-9]{3}\|[68][0-9]{4}\|[579][0-9]{2}))[0-9]{6}$` |
41+
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[01235-9][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([0-35-9][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[0-35-9][0-9]\{2\}\\|6[2567][0-9]\{2\}\\|4\(\(10\\|4[01]\)[0-9]\{3\}\\|[68][0-9]\{4\}\\|[579][0-9]\{2\}\)\)[0-9]\{6\}$` |
4242

4343
### Match all numbers with SMS (Phone number + Data only number)
4444

@@ -87,8 +87,8 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt
8787

8888
| Command | Regular Expression |
8989
| --- | --- |
90-
| GNU ERE | `^(+?86)?1(3[0-2]\|[578][56]\|66|96)[0-9]{8}$` |
91-
| GNU BRE | `^\(+\?86\)\?1\(3[0-2]\\|[578][56]\\|66|96\)[0-9]\{8\}$` |
90+
| GNU ERE | `^(+?86)?1(3[0-2]\|[578][56]\|66\|96)[0-9]{8}$` |
91+
| GNU BRE | `^\(+\?86\)\?1\(3[0-2]\\|[578][56]\\|66\\|96\)[0-9]\{8\}$` |
9292

9393
#### Match China Telecom
9494

@@ -109,7 +109,7 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt
109109
| GNU BRE | `^\(+\?86\)\?192[0-9]\{8\}$` |
110110
-->
111111

112-
| 命令 | 正则表达式 |
112+
| Command | Regular Expression |
113113
| --- | --- |
114114
| GNU ERE | `^(+?86)?192[0-9]{8}$` |
115115
| GNU BRE | `^\(+\?86\)\?192[0-9]\{8\}$` |
@@ -193,26 +193,26 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt
193193
#### Match all
194194

195195
<!--
196-
| GNU ERE | `^(+?86)?14([14]0|[68][0-9])[0-9]{9}$` |
197-
| GNU BRE | `^\(+\?86\)\?14\([14]0\|[68][0-9]\)[0-9]\{9\}$` |
196+
| GNU ERE | `^(+?86)?14([14]0|41|[68][0-9])[0-9]{9}$` |
197+
| GNU BRE | `^\(+\?86\)\?14\([14]0\|41\|[68][0-9]\)[0-9]\{9\}$` |
198198
-->
199199

200200
| Command | Regular Expression |
201201
| --- | --- |
202-
| GNU ERE | `^(+?86)?14([14]0\|[68][0-9])[0-9]{9}$` |
203-
| GNU BRE | `^\(+\?86\)\?14\([14]0\\|[68][0-9]\)[0-9]\{9\}$` |
202+
| GNU ERE | `^(+?86)?14([14]0\|41\|[68][0-9])[0-9]{9}$` |
203+
| GNU BRE | `^\(+\?86\)\?14\([14]0\\|41\\|[68][0-9]\)[0-9]\{9\}$` |
204204

205205
#### Match China Mobile
206206

207207
<!--
208-
| GNU ERE | `^(+?86)?14(40|8[0-9])[0-9]{9}$` |
209-
| GNU BRE | `^\(+\?86\)\?14\(40\|8[0-9]\)[0-9]\{9\}$` |
208+
| GNU ERE | `^(+?86)?14(4[01]|8[0-9])[0-9]{9}$` |
209+
| GNU BRE | `^\(+\?86\)\?14\(4[01]\|8[0-9]\)[0-9]\{9\}$` |
210210
-->
211211

212212
| Command | Regular Expression |
213213
| --- | --- |
214-
| GNU ERE | `^(+?86)?14(40\|8[0-9])[0-9]{9}$` |
215-
| GNU BRE | `^\(+\?86\)\?14\(40\\|8[0-9]\)[0-9]\{9\}$` |
214+
| GNU ERE | `^(+?86)?14(4[01]\|8[0-9])[0-9]{9}$` |
215+
| GNU BRE | `^\(+\?86\)\?14\(4[01]\\|8[0-9]\)[0-9]\{9\}$` |
216216

217217
#### Match China Unicom
218218

‎README-CN.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
###### 如果你需要 POSIX 标准的正则表达式,[点击这里](/POSIX-CN.md)
1212

1313
### 匹配所有号码(手机卡 + 数据卡 + 上网卡)
14-
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[0-35-9]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|6[2567]\d{2}|4(?:[14]0\d{3}|[68]\d{4}|[579]\d{2}))\d{6}$`][匹配所有号码(手机卡 + 数据卡 + 上网卡)]
14+
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[0-35-9]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|6[2567]\d{2}|4(?:(?:10|4[01])\d{3}|[68]\d{4}|[579]\d{2}))\d{6}$`][匹配所有号码(手机卡 + 数据卡 + 上网卡)]
1515

1616
### 匹配所有支持短信功能的号码(手机卡 + 上网卡)
1717
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[0-35-9]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|6[2567]\d{2}|4[579]\d{2})\d{6}$`][匹配所有支持短信功能的号码(手机卡 + 上网卡)]
@@ -56,10 +56,10 @@
5656
### 物联网数据卡
5757

5858
#### 匹配所有
59-
[`^(?:\+?86)?14(?:[14]0|[68]\d)\d{9}$`][匹配所有物联网数据卡]
59+
[`^(?:\+?86)?14(?:[14]0|41|[68]\d)\d{9}$`][匹配所有物联网数据卡]
6060

6161
#### 匹配中国移动
62-
[`^(?:\+?86)?14(?:40|8\d)\d{9}$`][匹配物联网中国移动]
62+
[`^(?:\+?86)?14(?:4[01]|8\d)\d{9}$`][匹配物联网中国移动]
6363

6464
#### 匹配中国联通
6565
[`^(?:\+?86)?146\d{10}$`][匹配物联网中国联通]
@@ -122,7 +122,7 @@ https://www.debuggex.com (PCRE 在线视觉化)
122122

123123
| 运营商 <sup>[1]<sup/> | 号段 |
124124
| --- | --- |
125-
| 中国移动 | 1440X / 148XX |
125+
| 中国移动 | 1440X / 1441X / 148XX |
126126
| 中国联通 | 146XX |
127127
| 中国电信 | 1410X |
128128

@@ -152,6 +152,9 @@ https://www.debuggex.com (PCRE 在线视觉化)
152152

153153
## 更新日志
154154

155+
#### 2020.05.03
156+
- 添加 1441 号段支持。
157+
155158
#### 2020.04.16
156159
- 添加 192 号段支持。
157160

@@ -206,7 +209,7 @@ MIT
206209

207210
[PCRE]: https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions
208211

209-
[匹配所有号码(手机卡 + 数据卡 + 上网卡)]: https://www.debuggex.com/r/OLNV3F0jAxT_6ToW
212+
[匹配所有号码(手机卡 + 数据卡 + 上网卡)]: https://www.debuggex.com/r/dwRbKIxaFfBEIkxh
210213

211214
[匹配所有支持短信功能的号码(手机卡 + 上网卡)]: https://www.debuggex.com/r/IivlZsRjoXSX_FJ3
212215

@@ -232,7 +235,7 @@ MIT
232235

233236
[匹配虚拟运营商中国电信]: https://www.debuggex.com/r/j22iLshKfI_avga-
234237

235-
[匹配所有物联网数据卡]: https://www.debuggex.com/r/95embzRGAR76zPIV
238+
[匹配所有物联网数据卡]: https://www.debuggex.com/r/paDEMqjp1F5dM40F
236239

237240
[匹配物联网中国移动]: https://www.debuggex.com/r/lVn_7eMXVOEiXXK_
238241

‎README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The mobile number portability(MNP) service in mainland China has been officially
1313
###### If you need POSIX standard regular expressions, [Click here](/POSIX.md).
1414

1515
### Match all numbers (Phone number + IoT number + Data only number)
16-
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[0-35-9]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|6[2567]\d{2}|4(?:[14]0\d{3}|[68]\d{4}|[579]\d{2}))\d{6}$`][Match all numbers (Phone number + IoT number + Data only number)]
16+
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[0-35-9]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|6[2567]\d{2}|4(?:(?:10|4[01])\d{3}|[68]\d{4}|[579]\d{2}))\d{6}$`][Match all numbers (Phone number + IoT number + Data only number)]
1717

1818
### Match all numbers with SMS (Phone number + Data only number)
1919
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[0-35-9]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|6[2567]\d{2}|4[579]\d{2})\d{6}$`][Match all numbers with SMS (Phone number + Data only number)]
@@ -58,10 +58,10 @@ The mobile number portability(MNP) service in mainland China has been officially
5858
### IoT number
5959

6060
#### Match all
61-
[`^(?:\+?86)?14(?:[14]0\d|[68]\d{2})\d{8}$`][Match IoT]
61+
[`^(?:\+?86)?14(?:[14]0|41|[68]\d)\d{9}$`][Match IoT]
6262

6363
#### Match China Mobile
64-
[`^(?:\+?86)?14(?:40|8\d)\d{9}$`][Match IoT China Mobile]
64+
[`^(?:\+?86)?14(?:4[01]|8\d)\d{9}$`][Match IoT China Mobile]
6565

6666
#### Match China Unicom
6767
[`^(?:\+?86)?146\d{10}$`][Match IoT China Unicom]
@@ -124,7 +124,7 @@ https://www.debuggex.com (PCRE visualizer)
124124

125125
| Carrier <sup>[1]<sup/> | Prefix |
126126
| --- | --- |
127-
| China Mobile | 1440X / 148XX |
127+
| China Mobile | 1440X / 1441X / 148XX |
128128
| China Unicom | 146XX |
129129
| China Telecom | 1410X |
130130

@@ -155,6 +155,9 @@ Since the mobile phone number regular expression is time-sensitive, when any reg
155155

156156
## Release Notes
157157

158+
#### May 3, 2020
159+
- Add support for 1441 prefix.
160+
158161
#### April 16, 2020
159162
- Add support for 192 prefix.
160163

@@ -209,7 +212,7 @@ MIT
209212

210213
[PCRE]: https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions
211214

212-
[Match all numbers (Phone number + IoT number + Data only number)]: https://www.debuggex.com/r/OLNV3F0jAxT_6ToW
215+
[Match all numbers (Phone number + IoT number + Data only number)]: https://www.debuggex.com/r/dwRbKIxaFfBEIkxh
213216

214217
[Match all numbers with SMS (Phone number + Data only number)]: https://www.debuggex.com/r/IivlZsRjoXSX_FJ3
215218

@@ -235,7 +238,7 @@ MIT
235238

236239
[Match MVNO China Telecom]: https://www.debuggex.com/r/j22iLshKfI_avga-
237240

238-
[Match IoT]: https://www.debuggex.com/r/95embzRGAR76zPIV
241+
[Match IoT]: https://www.debuggex.com/r/paDEMqjp1F5dM40F
239242

240243
[Match IoT China Mobile]: https://www.debuggex.com/r/lVn_7eMXVOEiXXK_
241244

0 commit comments

Comments
 (0)
Please sign in to comment.