当前位置:网站首页>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 '
}
}
};
边栏推荐
- 數據庫高級學習筆記--SQL語句
- Django running error: error loading mysqldb module solution
- QT creator runs the Valgrind tool on external applications
- AcWing 1294. Cherry Blossom explanation
- ES6 let and const commands
- Codeforces Round #771 (Div. 2)
- When you open the browser, you will also open mango TV, Tiktok and other websites outside the home page
- QT creator specifies dependencies
- Integration test practice (1) theoretical basis
- 01 project demand analysis (ordering system)
猜你喜欢

AcWing 1298. Solution to Cao Chong's pig raising problem

QT creator specifies dependencies

QT creator runs the Valgrind tool on external applications

分布式节点免密登录

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

QT creator design user interface

02 staff information management after the actual project

Software I2C based on Hal Library

MTCNN人脸检测

Install mongdb tutorial and redis tutorial under Windows
随机推荐
Error connecting to MySQL database: 2059 - authentication plugin 'caching_ sha2_ The solution of 'password'
jS数组+数组方法重构
nodejs连接Mysql
QT creator support platform
[Bluebridge cup 2020 preliminary] horizontal segmentation
机器学习笔记-Week02-卷积神经网络
Summary of numpy installation problems
误删Path变量解决
Codeforces Round #753 (Div. 3)
L2-007 家庭房产 (25 分)
What does usart1 mean
Vs2019 first MFC Application
【kerberos】深入理解kerberos票据生命周期
Codeforces Round #771 (Div. 2)
软件测试与质量学习笔记3--白盒测试
Neo4j installation tutorial
Machine learning notes week02 convolutional neural network
01 project demand analysis (ordering system)
数据库高级学习笔记--SQL语句
vs2019 使用向导生成一个MFC应用程序