1.0.0 • Published 6 years ago
china-mobile-phone-regexp v1.0.0
china-mobile-phone-regexp
The regular expressions for China mobile phones.
Install
$ npm i china-mobile-phone-regexp --save
Usage
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.