|
@@ -12,6 +12,10 @@ const utils = {
|
|
|
//是否为邮箱
|
|
|
return RegExp(/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/).test(value);
|
|
|
},
|
|
|
+ isWebsite: function(value){
|
|
|
+ //是否为网址
|
|
|
+ return RegExp(/^((http|ftp|https):\/\/[a-zA-Z0-9]|[a-zA-Z0-9])[-a-zA-Z0-9]{0,62}(.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+.?$/).test(value);
|
|
|
+ },
|
|
|
isMobile: function(value) {
|
|
|
//是否为手机号
|
|
|
return RegExp(/^1[1-9][0-9]{9}$/).test(value);
|
|
@@ -165,6 +169,7 @@ module.exports = {
|
|
|
trim: utils.trim,
|
|
|
isMobile: utils.isMobile,
|
|
|
isEmail: utils.isEmail,
|
|
|
+ isWebsite:utils.isWebsite,
|
|
|
isFloat: utils.isFloat,
|
|
|
isNum: utils.isNum,
|
|
|
isEmailCode:utils.isEmailCode,
|