1.1.3 • Published 6 years ago

multi-reg v1.1.3

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

regExp 正则大全

仓库收敛了数字字符特殊场景的情况。

支持amd、cmd、es6引入

var regStack = require(./reg);
var reg = regStack[type]   // 返回一个RegExp对象

// you can test or match it.
reg.test(111);  // false ? true

给出暴露的api说明:

cn-phone  大陆手机号
qq  腾讯qq号
email  邮箱
cn-id  大陆身份证
url  网址
car  车牌号
wechat  微信
date  日期
month 月份
day  天
ip  地址
ems  邮编

number 数字
ze-noze-num 零和非零开头的数字
noze-deci2  非零开头的最多带两位小数的数字
deci-1-2   带1-2位小数的正数或负数
p-n-deci  正数、负数、和小数
p-deci-d  有两位小数的正实数
p-deci-t  有1~3位小数的正实数
noze-p-int  非零的正整数
noze-n-int  非零的负整数
no-n-int  非负整数
no-p-int  非正整数
no-n-flo  非负浮点数
no-p-flo  非正浮点数
p-flo  正浮点数
n-flo  负浮点数
flo  浮点数

cn  汉字
cnum  英文和数字
3-c-20  长度为3-20的所有字符
en  由26个英文字母组成的字符串
uc  由26个大写英文字母组成的字符串
lc  由26个小写英文字母组成的字符串
enum  由数字和26个英文字母组成的字符串
cenum  由数字、26个英文字母或者下划线组成的字符串
normal  中文、英文、数字包括下划线
no-uline  中文、英文、数字但不包括下划线等符号
sp-code  可以输入含有^%&’,;=?$\”等字符
no-sp-code  禁止输入含有~的字符

欢迎使用