对比下图

现在还没有 92和98的手机号,之后会有的
// 手机号
const mobileRule = /(?:^1[3456789]|^9[28])\d{9}$/

// 座机
const phoneRule = /^[0]?\d{2,3}[- ]?\d{7,8}$/

// 座机及手机
const telephoneRule = /^[0]?\d{2,3}[- ]?\d{7,8}$|(?:^1[3456789]|^9[28])\d{9}$/

现在还没有 92和98的手机号,之后会有的
// 手机号
const mobileRule = /(?:^1[3456789]|^9[28])\d{9}$/
// 座机
const phoneRule = /^[0]?\d{2,3}[- ]?\d{7,8}$/
// 座机及手机
const telephoneRule = /^[0]?\d{2,3}[- ]?\d{7,8}$|(?:^1[3456789]|^9[28])\d{9}$/
本文标题:2018 手机号正则
本文链接:https://www.haomeiwen.com/subject/hqptcftx.html
网友评论