diff --git a/POSIX-CN.md b/POSIX-CN.md index 0c688b5..7487321 100644 --- a/POSIX-CN.md +++ b/POSIX-CN.md @@ -24,18 +24,19 @@ 这些转义字符并不是正则表达式所需要的。在您修改正则表达式的时候请多加小心。 为了防止渲染出现错误,所有的正则表达式都需要在注释中写清转义之前的语句。 + 参见 https://help.github.com/articles/organizing-information-with-tables/#formatting-content-within-your-table --> | 命令 | 正则表达式 | | --- | --- | -| 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}$` | -| 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\}$` | +| 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}$` | +| 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\}$` | ### 匹配所有支持短信功能的号码(手机卡 + 上网卡) @@ -84,8 +85,8 @@ | 命令 | 正则表达式 | | --- | --- | -| GNU ERE | `^(+?86)?1(3[0-2]\|[578][56]\|66|96)[0-9]{8}$` | -| GNU BRE | `^\(+\?86\)\?1\(3[0-2]\\|[578][56]\\|66|96\)[0-9]\{8\}$` | +| GNU ERE | `^(+?86)?1(3[0-2]\|[578][56]\|66\|96)[0-9]{8}$` | +| GNU BRE | `^\(+\?86\)\?1\(3[0-2]\\|[578][56]\\|66\\|96\)[0-9]\{8\}$` | #### 匹配中国电信 @@ -190,26 +191,26 @@ #### 匹配所有 | 命令 | 正则表达式 | | --- | --- | -| GNU ERE | `^(+?86)?14([14]0\|[68][0-9])[0-9]{9}$` | -| GNU BRE | `^\(+\?86\)\?14\([14]0\\|[68][0-9]\)[0-9]\{9\}$` | +| GNU ERE | `^(+?86)?14([14]0\|41\|[68][0-9])[0-9]{9}$` | +| GNU BRE | `^\(+\?86\)\?14\([14]0\\|41\\|[68][0-9]\)[0-9]\{9\}$` | #### 匹配中国移动 | 命令 | 正则表达式 | | --- | --- | -| GNU ERE | `^(+?86)?14(40\|8[0-9])[0-9]{9}$` | -| GNU BRE | `^\(+\?86\)\?14\(40\\|8[0-9]\)[0-9]\{9\}$` | +| GNU ERE | `^(+?86)?14(4[01]\|8[0-9])[0-9]{9}$` | +| GNU BRE | `^\(+\?86\)\?14\(4[01]\\|8[0-9]\)[0-9]\{9\}$` | #### 匹配中国联通 diff --git a/POSIX.md b/POSIX.md index 78d1e9f..4387510 100644 --- a/POSIX.md +++ b/POSIX.md @@ -31,14 +31,14 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt --> | Command | Regular Expression | | --- | --- | -| 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}$` | -| 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\}$` | +| 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}$` | +| 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\}$` | ### Match all numbers with SMS (Phone number + Data only number) @@ -87,8 +87,8 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt | Command | Regular Expression | | --- | --- | -| GNU ERE | `^(+?86)?1(3[0-2]\|[578][56]\|66|96)[0-9]{8}$` | -| GNU BRE | `^\(+\?86\)\?1\(3[0-2]\\|[578][56]\\|66|96\)[0-9]\{8\}$` | +| GNU ERE | `^(+?86)?1(3[0-2]\|[578][56]\|66\|96)[0-9]{8}$` | +| GNU BRE | `^\(+\?86\)\?1\(3[0-2]\\|[578][56]\\|66\\|96\)[0-9]\{8\}$` | #### Match China Telecom @@ -109,7 +109,7 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt | GNU BRE | `^\(+\?86\)\?192[0-9]\{8\}$` | --> -| 命令 | 正则表达式 | +| Command | Regular Expression | | --- | --- | | GNU ERE | `^(+?86)?192[0-9]{8}$` | | GNU BRE | `^\(+\?86\)\?192[0-9]\{8\}$` | @@ -193,26 +193,26 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt #### Match all | Command | Regular Expression | | --- | --- | -| GNU ERE | `^(+?86)?14([14]0\|[68][0-9])[0-9]{9}$` | -| GNU BRE | `^\(+\?86\)\?14\([14]0\\|[68][0-9]\)[0-9]\{9\}$` | +| GNU ERE | `^(+?86)?14([14]0\|41\|[68][0-9])[0-9]{9}$` | +| GNU BRE | `^\(+\?86\)\?14\([14]0\\|41\\|[68][0-9]\)[0-9]\{9\}$` | #### Match China Mobile | Command | Regular Expression | | --- | --- | -| GNU ERE | `^(+?86)?14(40\|8[0-9])[0-9]{9}$` | -| GNU BRE | `^\(+\?86\)\?14\(40\\|8[0-9]\)[0-9]\{9\}$` | +| GNU ERE | `^(+?86)?14(4[01]\|8[0-9])[0-9]{9}$` | +| GNU BRE | `^\(+\?86\)\?14\(4[01]\\|8[0-9]\)[0-9]\{9\}$` | #### Match China Unicom diff --git a/README-CN.md b/README-CN.md index c757700..ec3d4ed 100644 --- a/README-CN.md +++ b/README-CN.md @@ -11,7 +11,7 @@ ###### 如果你需要 POSIX 标准的正则表达式,[点击这里](/POSIX-CN.md) ### 匹配所有号码(手机卡 + 数据卡 + 上网卡) -[`^(?:\+?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}$`][匹配所有号码(手机卡 + 数据卡 + 上网卡)] +[`^(?:\+?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}$`][匹配所有号码(手机卡 + 数据卡 + 上网卡)] ### 匹配所有支持短信功能的号码(手机卡 + 上网卡) [`^(?:\+?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 @@ ### 物联网数据卡 #### 匹配所有 -[`^(?:\+?86)?14(?:[14]0|[68]\d)\d{9}$`][匹配所有物联网数据卡] +[`^(?:\+?86)?14(?:[14]0|41|[68]\d)\d{9}$`][匹配所有物联网数据卡] #### 匹配中国移动 -[`^(?:\+?86)?14(?:40|8\d)\d{9}$`][匹配物联网中国移动] +[`^(?:\+?86)?14(?:4[01]|8\d)\d{9}$`][匹配物联网中国移动] #### 匹配中国联通 [`^(?:\+?86)?146\d{10}$`][匹配物联网中国联通] @@ -122,7 +122,7 @@ https://www.debuggex.com (PCRE 在线视觉化) | 运营商 [1] | 号段 | | --- | --- | -| 中国移动 | 1440X / 148XX | +| 中国移动 | 1440X / 1441X / 148XX | | 中国联通 | 146XX | | 中国电信 | 1410X | @@ -152,6 +152,9 @@ https://www.debuggex.com (PCRE 在线视觉化) ## 更新日志 +#### 2020.05.03 +- 添加 1441 号段支持。 + #### 2020.04.16 - 添加 192 号段支持。 @@ -206,7 +209,7 @@ MIT [PCRE]: https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions -[匹配所有号码(手机卡 + 数据卡 + 上网卡)]: https://www.debuggex.com/r/OLNV3F0jAxT_6ToW +[匹配所有号码(手机卡 + 数据卡 + 上网卡)]: https://www.debuggex.com/r/dwRbKIxaFfBEIkxh [匹配所有支持短信功能的号码(手机卡 + 上网卡)]: https://www.debuggex.com/r/IivlZsRjoXSX_FJ3 @@ -232,7 +235,7 @@ MIT [匹配虚拟运营商中国电信]: https://www.debuggex.com/r/j22iLshKfI_avga- -[匹配所有物联网数据卡]: https://www.debuggex.com/r/95embzRGAR76zPIV +[匹配所有物联网数据卡]: https://www.debuggex.com/r/paDEMqjp1F5dM40F [匹配物联网中国移动]: https://www.debuggex.com/r/lVn_7eMXVOEiXXK_ diff --git a/README.md b/README.md index ea1669a..c9afde1 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The mobile number portability(MNP) service in mainland China has been officially ###### If you need POSIX standard regular expressions, [Click here](/POSIX.md). ### Match all numbers (Phone number + IoT number + Data only number) -[`^(?:\+?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)] +[`^(?:\+?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)] ### Match all numbers with SMS (Phone number + Data only number) [`^(?:\+?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 ### IoT number #### Match all -[`^(?:\+?86)?14(?:[14]0\d|[68]\d{2})\d{8}$`][Match IoT] +[`^(?:\+?86)?14(?:[14]0|41|[68]\d)\d{9}$`][Match IoT] #### Match China Mobile -[`^(?:\+?86)?14(?:40|8\d)\d{9}$`][Match IoT China Mobile] +[`^(?:\+?86)?14(?:4[01]|8\d)\d{9}$`][Match IoT China Mobile] #### Match China Unicom [`^(?:\+?86)?146\d{10}$`][Match IoT China Unicom] @@ -124,7 +124,7 @@ https://www.debuggex.com (PCRE visualizer) | Carrier [1] | Prefix | | --- | --- | -| China Mobile | 1440X / 148XX | +| China Mobile | 1440X / 1441X / 148XX | | China Unicom | 146XX | | China Telecom | 1410X | @@ -155,6 +155,9 @@ Since the mobile phone number regular expression is time-sensitive, when any reg ## Release Notes +#### May 3, 2020 +- Add support for 1441 prefix. + #### April 16, 2020 - Add support for 192 prefix. @@ -209,7 +212,7 @@ MIT [PCRE]: https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions -[Match all numbers (Phone number + IoT number + Data only number)]: https://www.debuggex.com/r/OLNV3F0jAxT_6ToW +[Match all numbers (Phone number + IoT number + Data only number)]: https://www.debuggex.com/r/dwRbKIxaFfBEIkxh [Match all numbers with SMS (Phone number + Data only number)]: https://www.debuggex.com/r/IivlZsRjoXSX_FJ3 @@ -235,7 +238,7 @@ MIT [Match MVNO China Telecom]: https://www.debuggex.com/r/j22iLshKfI_avga- -[Match IoT]: https://www.debuggex.com/r/95embzRGAR76zPIV +[Match IoT]: https://www.debuggex.com/r/paDEMqjp1F5dM40F [Match IoT China Mobile]: https://www.debuggex.com/r/lVn_7eMXVOEiXXK_