UNPKG
web-tools_td_20171017
Version:
latest (2.0.1)
2.0.1
前端业务代码工具库
github.com/Time-coding/webtools
Time-coding/webtools
web-tools_td_20171017
/
isPhoneNum.js
11 lines
(10 loc)
•
252 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
/** * *
@desc
判断是否为手机号 *
@param
{
String|Number
} str *
@return
{
Boolean
} */
function
isPhoneNum
(
str
) {
return
/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/
.
test
(str) }
module
.
exports
= isPhoneNum