当前位置:网站首页>Common regular expression collation
Common regular expression collation
2022-07-06 11:35:00 【iatkotworld】
Regular expression collation is often used for form verification ( Continuous updating )
Sort out common regular expressions
const verifyObj = {
money: function (value, item) {
if (value && !(/^([1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(value))) {
return ' Please enter the correct amount , Two decimal places at most '
}
},
emails: function (value, item) {
if (value && !(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(value))) {
return ' Please enter the correct email '
}
},
number: function (value, item) {
if (value && !(/^\d*$/.test(value))) {
return ' Please enter a pure number '
}
},
bankCard: function (value, item) {
if (value && !(/^([1-9]{1})(\d{14}|\d{18})$/.test(value))) {
return ' Please enter the correct bank card number '
}
},
mobilephone: function (value, item) {
if (value && !(/^1[3,4,5,6,7,8,9]\d{9}$/.test(value))) {
return ' Enter the correct phone number '
}
},
phone: function (value, item) {
if (value && !(/^((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/.test(value))) {
return ' Enter the correct contact information '
}
},
idCard: function() {
if (value && !(v.test(value))) {
return ' Please enter the correct ID number '
}
},
num1t100: function (value, item) {
if (value && !(/^\d{1,2}\.?\d{0,4}$|100/.test(value))) {
return ' Please enter 0-100 The number of , Keep up to four decimal places '
}
}
};
边栏推荐
- When using lambda to pass parameters in a loop, the parameters are always the same value
- SQL time injection
- Number game
- ImportError: libmysqlclient. so. 20: Cannot open shared object file: no such file or directory solution
- AcWing 1294. Cherry Blossom explanation
- [Flink] Flink learning
- Heating data in data lake?
- 天梯赛练习集题解LV1(all)
- 库函数--(持续更新)
- Knowledge Q & A based on Apache Jena
猜你喜欢

分布式节点免密登录

学习问题1:127.0.0.1拒绝了我们的访问

Learn winpwn (3) -- sEH from scratch

In the era of DFI dividends, can TGP become a new benchmark for future DFI?

Cookie setting three-day secret free login (run tutorial)

How to build a new project for keil5mdk (with super detailed drawings)

Knowledge Q & A based on Apache Jena

Learn winpwn (2) -- GS protection from scratch

When you open the browser, you will also open mango TV, Tiktok and other websites outside the home page

解决安装Failed building wheel for pillow
随机推荐
L2-006 tree traversal (25 points)
Face recognition_ recognition
數據庫高級學習筆記--SQL語句
AcWing 242. A simple integer problem (tree array + difference)
vs2019 桌面程序快速入门
SQL时间注入
机器学习笔记-Week02-卷积神经网络
vs2019 第一个MFC应用程序
软件测试与质量学习笔记3--白盒测试
【presto】presto 参数配置优化
02 staff information management after the actual project
Machine learning notes week02 convolutional neural network
2020网鼎杯_朱雀组_Web_nmap
L2-007 家庭房产 (25 分)
Integration test practice (1) theoretical basis
【CDH】CDH5.16 配置 yarn 任务集中分配设置不生效问题
L2-001 emergency rescue (25 points)
How to configure flymcu (STM32 serial port download software) is shown in super detail
{one week summary} take you into the ocean of JS knowledge
Valentine's Day flirting with girls to force a small way, one can learn