https://github.com/node-modules/china-mobile-phone-regexp
The regular expressions for China mobile phone number.
https://github.com/node-modules/china-mobile-phone-regexp
Last synced: 12 months ago
JSON representation
The regular expressions for China mobile phone number.
- Host: GitHub
- URL: https://github.com/node-modules/china-mobile-phone-regexp
- Owner: node-modules
- License: mit
- Created: 2018-08-18T06:53:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-18T14:56:19.000Z (almost 8 years ago)
- Last Synced: 2025-05-28T03:40:40.167Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 60
- Watchers: 13
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
# china-mobile-phone-regexp
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]
[npm-image]: https://img.shields.io/npm/v/china-mobile-phone-regexp.svg?style=flat-square
[npm-url]: https://npmjs.org/package/china-mobile-phone-regexp
[travis-image]: https://img.shields.io/travis/node-modules/china-mobile-phone-regexp.svg?style=flat-square
[travis-url]: https://travis-ci.org/node-modules/china-mobile-phone-regexp
[codecov-image]: https://img.shields.io/codecov/c/github/node-modules/china-mobile-phone-regexp.svg?style=flat-square
[codecov-url]: https://codecov.io/github/node-modules/china-mobile-phone-regexp?branch=master
[david-image]: https://img.shields.io/david/node-modules/china-mobile-phone-regexp.svg?style=flat-square
[david-url]: https://david-dm.org/node-modules/china-mobile-phone-regexp
[snyk-image]: https://snyk.io/test/npm/china-mobile-phone-regexp/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/china-mobile-phone-regexp
[download-image]: https://img.shields.io/npm/dm/china-mobile-phone-regexp.svg?style=flat-square
[download-url]: https://npmjs.org/package/china-mobile-phone-regexp
[The regular expressions](https://github.com/fengmk2/ChinaMobilePhoneNumberRegex) for China mobile phones.
## Install
```bash
$ npm i china-mobile-phone-regexp --save
```
## Usage
```js
const phone = require('china-mobile-phone-regexp');
// Is phone number?
console.log(phone.is('13800138000'));
// Is CHINA_MOBILE phone number?
console.log(phone.is('13800138000', phone.CHINA_MOBILE));
// Is CHINA_UNICOM phone number?
console.log(phone.is('13800138000', phone.CHINA_UNICOM));
// Is CHINA_TELECOM phone number?
console.log(phone.is('13800138000', phone.CHINA_TELECOM));
```
## Questions & Suggestions
Please open an issue [here](https://github.com/node-modules/china-mobile-phone-regexp/issues).
## License
[MIT](LICENSE)