当前位置:网站首页>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 '
}
}
};
边栏推荐
- Project practice - background employee information management (add, delete, modify, check, login and exit)
- What does BSP mean
- Password free login of distributed nodes
- About string immutability
- 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
- L2-007 家庭房产 (25 分)
- Tcp/ip protocol (UDP)
- Number game
猜你喜欢
Password free login of distributed nodes
vs2019 桌面程序快速入门
【yarn】CDP集群 Yarn配置capacity调度器批量分配
QT creator runs the Valgrind tool on external applications
4、安装部署Spark(Spark on Yarn模式)
【flink】flink学习
MySQL and C language connection (vs2019 version)
When you open the browser, you will also open mango TV, Tiktok and other websites outside the home page
[蓝桥杯2017初赛]方格分割
4. Install and deploy spark (spark on Yan mode)
随机推荐
Cookie setting three-day secret free login (run tutorial)
分布式節點免密登錄
Why can't STM32 download the program
L2-007 family real estate (25 points)
L2-007 家庭房产 (25 分)
jS数组+数组方法重构
When using lambda to pass parameters in a loop, the parameters are always the same value
QT creator test
SQL time injection
Codeforces Round #753 (Div. 3)
天梯赛练习集题解LV1(all)
[CDH] modify the default port 7180 of cloudera manager in cdh/cdp environment
{一周总结}带你走进js知识的海洋
学习问题1:127.0.0.1拒绝了我们的访问
L2-001 紧急救援 (25 分)
Valentine's Day flirting with girls to force a small way, one can learn
Why can't I use the @test annotation after introducing JUnit
Heating data in data lake?
error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_ s instead
Antlr4 uses keywords as identifiers