Skip to content

Commit

Permalink
Merge pull request #23 from VincentSit/patch
Browse files Browse the repository at this point in the history
Add support for 190 / 196 / 197 prefix.
  • Loading branch information
VincentSit authored Dec 25, 2019
2 parents ba3fc14 + 35cf348 commit b350d51
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 61 deletions.
33 changes: 12 additions & 21 deletions POSIX-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,40 @@
-->

<!--
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[012356789][0-9]{2}|8[0-9]{3}|7([01356789][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[13589][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[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([01356789][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[13589][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[012356789][0-9]{2}|8[0-9]{3}|7([01356789][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[01356789][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[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([01356789][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[01356789][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[012356789][0-9]{2}\|8[0-9]{3}\|7([01356789][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[13589][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[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([01356789][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[13589][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[012356789][0-9]{2}\|8[0-9]{3}\|7([01356789][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[01356789][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[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([01356789][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[01356789][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[012356789][0-9]{2}|8[0-9]{3}|7([01356789][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[13589][0-9]{2}|6[2567][0-9]{2}|4[579][0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([01356789][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[13589][0-9]\{2\}\|6[2567][0-9]\{2\}\|4[579][0-9]\{2\}\)[0-9]\{6\}$` |
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[012356789][0-9]{2}|8[0-9]{3}|7([01356789][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[01356789][0-9]{2}|6[2567][0-9]{2}|4[579][0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([01356789][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[01356789][0-9]\{2\}\|6[2567][0-9]\{2\}\|4[579][0-9]\{2\}\)[0-9]\{6\}$` |
-->

| 命令 | 正则表达式 |
| --- | --- |
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[012356789][0-9]{2}\|8[0-9]{3}\|7([01356789][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[13589][0-9]{2}\|6[2567][0-9]{2}\|4[579][0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([01356789][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[13589][0-9]\{2\}\\|6[2567][0-9]\{2\}\\|4[579][0-9]\{2\}\)[0-9]\{6\}$` |
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[012356789][0-9]{2}\|8[0-9]{3}\|7([01356789][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[01356789][0-9]{2}\|6[2567][0-9]{2}\|4[579][0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([01356789][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[01356789][0-9]\{2\}\\|6[2567][0-9]\{2\}\\|4[579][0-9]\{2\}\)[0-9]\{6\}$` |

### 手机卡

#### 匹配所有

<!--
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[012356789][0-9]{2}|8[0-9]{3}|7([35678][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[13589][0-9]{2}|66[0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([35678][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[13589][0-9]\{2\}\|66[0-9]\{2\}\)[0-9]\{6\}$` |
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[012356789][0-9]{2}|8[0-9]{3}|7([35678][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[01356789][0-9]{2}|66[0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([35678][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[01356789][0-9]\{2\}\|66[0-9]\{2\}\)[0-9]\{6\}$` |
-->

| 命令 | 正则表达式 |
| --- | --- |
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[012356789][0-9]{2}\|8[0-9]{3}\|7([35678][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[13589][0-9]{2}\|66[0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([35678][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[13589][0-9]\{2\}\\|66[0-9]\{2\}\)[0-9]\{6\}$` |
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[012356789][0-9]{2}\|8[0-9]{3}\|7([35678][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[01356789][0-9]{2}\|66[0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([35678][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[01356789][0-9]\{2\}\\|66[0-9]\{2\}\)[0-9]\{6\}$` |

#### 匹配中国移动

Expand Down Expand Up @@ -244,15 +244,6 @@
| GNU BRE | `^\(+\?86\)\?149[0-9]\{8\}$` |


## 更新日志

#### 2019.12.24
- 添加 162 / 193 / 195 号段支持。

#### 2019.01.12
- 发布首个兼容 GNU BRE 和 GNU ERE 的版本。


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

[POSIX]: https://en.wikipedia.org/wiki/Regular_expression#Standards
Expand Down
34 changes: 12 additions & 22 deletions POSIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,40 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt
-->

<!--
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[012356789][0-9]{2}|8[0-9]{3}|7([01356789][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[13589][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[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([01356789][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[13589][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[012356789][0-9]{2}|8[0-9]{3}|7([01356789][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[01356789][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[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([01356789][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[01356789][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\}$` |
-->

| Command | Regular Expression |
| --- | --- |
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[012356789][0-9]{2}\|8[0-9]{3}\|7([01356789][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[13589][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[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([01356789][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[13589][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[012356789][0-9]{2}\|8[0-9]{3}\|7([01356789][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[01356789][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[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([01356789][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[01356789][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\}$` |

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

<!--
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[012356789][0-9]{2}|8[0-9]{3}|7([01356789][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[13589][0-9]{2}|6[2567][0-9]{2}|4[579][0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([01356789][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[13589][0-9]\{2\}\|6[2567][0-9]\{2\}\|4[579][0-9]\{2\}\)[0-9]\{6\}$` |
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[012356789][0-9]{2}|8[0-9]{3}|7([01356789][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[01356789][0-9]{2}|6[2567][0-9]{2}|4[579][0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([01356789][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[01356789][0-9]\{2\}\|6[2567][0-9]\{2\}\|4[579][0-9]\{2\}\)[0-9]\{6\}$` |
-->

| Command | Regular Expression |
| --- | --- |
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[012356789][0-9]{2}\|8[0-9]{3}\|7([01356789][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[13589][0-9]{2}\|6[2567][0-9]{2}\|4[579][0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([01356789][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[13589][0-9]\{2\}\\|6[2567][0-9]\{2\}\\|4[579][0-9]\{2\}\)[0-9]\{6\}$` |
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[012356789][0-9]{2}\|8[0-9]{3}\|7([01356789][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[01356789][0-9]{2}\|6[2567][0-9]{2}\|4[579][0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([01356789][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[01356789][0-9]\{2\}\\|6[2567][0-9]\{2\}\\|4[579][0-9]\{2\}\)[0-9]\{6\}$` |

### Mobile phone number

#### Match all

<!--
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[012356789][0-9]{2}|8[0-9]{3}|7([35678][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[13589][0-9]{2}|66[0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([35678][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[13589][0-9]\{2\}\|66[0-9]\{2\}\)[0-9]\{6\}$` |
| GNU ERE | `^(+?86)?1(3[0-9]{3}|5[012356789][0-9]{2}|8[0-9]{3}|7([35678][0-9]{2}|4(0[0-9]|1[0-2]|9[0-9]))|9[01356789][0-9]{2}|66[0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\|5[012356789][0-9]\{2\}\|8[0-9]\{3\}\|7\([35678][0-9]\{2\}\|4\(0[0-9]\|1[0-2]\|9[0-9]\)\)\|9[01356789][0-9]\{2\}\|66[0-9]\{2\}\)[0-9]\{6\}$` |
-->

| Command | Regular Expression |
| --- | --- |
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[012356789][0-9]{2}\|8[0-9]{3}\|7([35678][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[13589][0-9]{2}\|66[0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([35678][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[13589][0-9]\{2\}\\|66[0-9]\{2\}\)[0-9]\{6\}$` |
| GNU ERE | `^(+?86)?1(3[0-9]{3}\|5[012356789][0-9]{2}\|8[0-9]{3}\|7([35678][0-9]{2}\|4(0[0-9]\|1[0-2]\|9[0-9]))\|9[01356789][0-9]{2}\|66[0-9]{2})[0-9]{6}$` |
| GNU BRE | `^\(+\?86\)\?1\(3[0-9]\{3\}\\|5[012356789][0-9]\{2\}\\|8[0-9]\{3\}\\|7\([35678][0-9]\{2\}\\|4\(0[0-9]\\|1[0-2]\\|9[0-9]\)\)\\|9[01356789][0-9]\{2\}\\|66[0-9]\{2\}\)[0-9]\{6\}$` |

#### Match China Mobile

Expand Down Expand Up @@ -247,16 +247,6 @@ See https://help.github.com/articles/organizing-information-with-tables/#formatt
| GNU BRE | `^\(+\?86\)\?149[0-9]\{8\}$` |


## Release Notes

#### December 24, 2019
- Add support for 162 / 193 / 195 prefix.


#### 2019.01.12
- The first version compatible with POSIX standard (GNU BRE and GNU ERE).


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

[POSIX]: https://en.wikipedia.org/wiki/Regular_expression#Standards
Expand Down
22 changes: 13 additions & 9 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
###### 如果你需要 POSIX 标准的正则表达式,[点击这里](/POSIX-CN.md)

### 匹配所有号码(手机卡 + 数据卡 + 上网卡)
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[01356789]\d{2}|4(?:0\d|1[0-2]|9\d))|9[13589]\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(?:[01356789]\d{2}|4(?:0\d|1[0-2]|9\d))|9[01356789]\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(?:[01356789]\d{2}|4(?:0\d|1[0-2]|9\d))|9[13589]\d{2}|6[2567]\d{2}|4[579]\d{2})\d{6}$`][匹配所有支持短信功能的号码(手机卡 + 上网卡)]
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[01356789]\d{2}|4(?:0\d|1[0-2]|9\d))|9[01356789]\d{2}|6[2567]\d{2}|4[579]\d{2})\d{6}$`][匹配所有支持短信功能的号码(手机卡 + 上网卡)]

### 手机卡

#### 匹配所有
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[35678]\d{2}|4(?:0\d|1[0-2]|9\d))|9[13589]\d{2}|66\d{2})\d{6}$`][匹配基础运营商]
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[35678]\d{2}|4(?:0\d|1[0-2]|9\d))|9[01356789]\d{2}|66\d{2})\d{6}$`][匹配基础运营商]

#### 匹配中国移动
[`^(?:\+?86)?1(?:3(?:4[^9\D]|[5-9]\d)|5[^3-6\D]\d|8[23478]\d|(?:78|98)\d)\d{7}$`][匹配基础运营商中国移动]
Expand Down Expand Up @@ -93,9 +93,10 @@ https://www.debuggex.com (PCRE 在线视觉化)

| 运营商 <sup>[1]<sup/> | 号段 |
| --- | --- |
| 中国移动 | 134-0~8 / 135 / 136 / 137 / 138 / 139 / 150 / 151 / 152 / 157 / 158 / 159 / 178 / 182 / 183 / 184 / 187 / 188 / 195 / 198 |
| 中国联通 | 130 / 131 / 132 / 155 / 156 / 166 / 175 / 176 / 185 / 186 |
| 中国电信 | 133 / 134-9 / 153 / 173 / 174-00~05 / 177 / 180 / 181 / 189 / 191 / 193 / 199 |
| 中国移动 | 134-0~8 / 135 / 136 / 137 / 138 / 139 / 150 / 151 / 152 / 157 / 158 / 159 / 178 / 182 / 183 / 184 / 187 / 188 / 195 / 197 / 198 |
| 中国联通 | 130 / 131 / 132 / 155 / 156 / 166 / 175 / 176 / 185 / 186 / 196 |
| 中国电信 | 133 / 134-9 / 153 / 173 / 174-00~05 / 177 / 180 / 181 / 189 / 190 / 191 / 193 / 199 |
| 中国广电 | 192 |
| 北京船舶通信导航有限公司(海事卫星通信) | 174-9 |
| 工业和信息化部应急通信保障中心(应急通信) | 174-06~12 |

Expand Down Expand Up @@ -148,6 +149,9 @@ https://www.debuggex.com (PCRE 在线视觉化)

## 更新日志

#### 2019.12.26
- 添加 190 / 196 / 197 号段支持。

#### 2019.12.24
- 添加 162 / 193 / 195 号段支持。

Expand Down Expand Up @@ -193,11 +197,11 @@ MIT

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

[匹配所有号码(手机卡 + 数据卡 + 上网卡)]: https://www.debuggex.com/r/bI_nSAY542fXCKTU
[匹配所有号码(手机卡 + 数据卡 + 上网卡)]: https://www.debuggex.com/r/bGTEJTtkPpRBGGmZ

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

[匹配基础运营商]: https://www.debuggex.com/r/SARQVQHK81YkIVBw
[匹配基础运营商]: https://www.debuggex.com/r/MdCwnbmyRqFWFCWT

[匹配基础运营商中国移动]: https://www.debuggex.com/r/dbF9BmNrGrq4vvWi

Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ 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(?:[01356789]\d{2}|4(?:0\d|1[0-2]|9\d))|9[13589]\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(?:[01356789]\d{2}|4(?:0\d|1[0-2]|9\d))|9[01356789]\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)]

### Match all numbers with SMS (Phone number + Data only number)
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[01356789]\d{2}|4(?:0\d|1[0-2]|9\d))|9[13589]\d{2}|6[2567]\d{2}|4[579]\d{2})\d{6}$`][Match all numbers with SMS (Phone number + Data only number)]
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[01356789]\d{2}|4(?:0\d|1[0-2]|9\d))|9[01356789]\d{2}|6[2567]\d{2}|4[579]\d{2})\d{6}$`][Match all numbers with SMS (Phone number + Data only number)]

### Mobile phone number

#### Match all
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[35678]\d{2}|4(?:0\d|1[0-2]|9\d))|9[13589]\d{2}|66\d{2})\d{6}$`][Match Carrier]
[`^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[35678]\d{2}|4(?:0\d|1[0-2]|9\d))|9[01356789]\d{2}|66\d{2})\d{6}$`][Match Carrier]

#### Match China Mobile
[`^(?:\+?86)?1(?:3(?:4[^9\D]|[5-9]\d)|5[^3-6\D]\d|8[23478]\d|(?:78|98)\d)\d{7}$`][Match Carrier China Mobile]
Expand Down Expand Up @@ -95,9 +95,9 @@ https://www.debuggex.com (PCRE visualizer)

| Carrier <sup>[1]<sup/> | Prefix |
| --- | --- |
| China Mobile | 134-0~8 / 135 / 136 / 137 / 138 / 139 / 150 / 151 / 152 / 157 / 158 / 159 / 178 / 182 / 183 / 184 / 187 / 188 / 195 / 198 |
| China Unicom | 130 / 131 / 132 / 155 / 156 / 166 / 175 / 176 / 185 / 186 |
| China Telecom | 133 / 134-9 / 153 / 173 / 174-00~05 / 177 / 180 / 181 / 189 / 191 / 193 / 199 |
| China Mobile | 134-0~8 / 135 / 136 / 137 / 138 / 139 / 150 / 151 / 152 / 157 / 158 / 159 / 178 / 182 / 183 / 184 / 187 / 188 / 195 / 197 / 198 |
| China Unicom | 130 / 131 / 132 / 155 / 156 / 166 / 175 / 176 / 185 / 186 / 196 |
| China Telecom | 133 / 134-9 / 153 / 173 / 174-00~05 / 177 / 180 / 181 / 189 / 190 / 191 / 193 / 199 |
| Inmarsat (Satellite) <sup>[2]<sup/> | 174-9 |
| Emergency Communication Support Center of MIIT (Emergency communications) | 174-06~12 |

Expand Down Expand Up @@ -151,6 +151,9 @@ Since the mobile phone number regular expression is time-sensitive, when any reg

## Release Notes

#### December 26, 2019
- Add support for 190 / 196 / 197 prefix.

#### December 24, 2019
- Add support for 162 / 193 / 195 prefix.

Expand Down Expand Up @@ -196,11 +199,11 @@ 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/bI_nSAY542fXCKTU
[Match all numbers (Phone number + IoT number + Data only number)]: https://www.debuggex.com/r/bGTEJTtkPpRBGGmZ

[Match all numbers with SMS (Phone number + Data only number)]: https://www.debuggex.com/r/Wm42QqxS69C4FyYU
[Match all numbers with SMS (Phone number + Data only number)]: https://www.debuggex.com/r/AT6yjr-CCHDJ8Zzp

[Match Carrier]: https://www.debuggex.com/r/SARQVQHK81YkIVBw
[Match Carrier]: https://www.debuggex.com/r/MdCwnbmyRqFWFCWT

[Match Carrier China Mobile]: https://www.debuggex.com/r/dbF9BmNrGrq4vvWi

Expand Down

0 comments on commit b350d51

Please sign in to comment.