当前位置:网站首页>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 '
}
}
};
边栏推荐
- Punctual atom stm32f103zet6 download serial port pin
- Mtcnn face detection
- L2-004 这是二叉搜索树吗? (25 分)
- Julia 1.6 1.7 common problem solving
- [CDH] modify the default port 7180 of cloudera manager in cdh/cdp environment
- Codeforces Round #753 (Div. 3)
- Heating data in data lake?
- [BSidesCF_2020]Had_ a_ bad_ day
- Machine learning notes week02 convolutional neural network
- 学习问题1:127.0.0.1拒绝了我们的访问
猜你喜欢

vs2019 使用向导生成一个MFC应用程序

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

error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_s instead

Request object and response object analysis

Nanny level problem setting tutorial

vs2019 第一个MFC应用程序

QT creator custom build process

{一周总结}带你走进js知识的海洋
C语言读取BMP文件

Double to int precision loss
随机推荐
机器学习笔记-Week02-卷积神经网络
学习问题1:127.0.0.1拒绝了我们的访问
[BSidesCF_2020]Had_ a_ bad_ day
牛客Novice月赛40
[Bluebridge cup 2020 preliminary] horizontal segmentation
MySQL与c语言连接(vs2019版)
使用lambda在循环中传参时,参数总为同一个值
Password free login of distributed nodes
Reading BMP file with C language
Tcp/ip protocol (UDP)
MySQL and C language connection (vs2019 version)
Solve the problem of installing failed building wheel for pilot
L2-007 家庭房产 (25 分)
[蓝桥杯2017初赛]方格分割
[Kerberos] deeply understand the Kerberos ticket life cycle
QT creator specify editor settings
How to configure flymcu (STM32 serial port download software) is shown in super detail
Error connecting to MySQL database: 2059 - authentication plugin 'caching_ sha2_ The solution of 'password'
QT creator design user interface
【kerberos】深入理解kerberos票据生命周期