当前位置:网站首页>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 '
}
}
};
边栏推荐
- Cookie setting three-day secret free login (run tutorial)
- About string immutability
- 【CDH】CDH5.16 配置 yarn 任务集中分配设置不生效问题
- QT creator runs the Valgrind tool on external applications
- AcWing 1298.曹冲养猪 题解
- L2-001 emergency rescue (25 points)
- nodejs 详解
- Learn winpwn (3) -- sEH from scratch
- AcWing 1294.樱花 题解
- Software I2C based on Hal Library
猜你喜欢
QT creator design user interface
Mtcnn face detection
Machine learning -- census data analysis
Image recognition - pyteseract TesseractNotFoundError: tesseract is not installed or it‘s not in your path
Learning question 1:127.0.0.1 refused our visit
Password free login of distributed nodes
error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_ s instead
Software testing and quality learning notes 3 -- white box testing
QT creator specifies dependencies
AI benchmark V5 ranking
随机推荐
[CDH] modify the default port 7180 of cloudera manager in cdh/cdp environment
学习问题1:127.0.0.1拒绝了我们的访问
AcWing 1294. Cherry Blossom explanation
Learn winpwn (2) -- GS protection from scratch
SQL时间注入
Codeforces Round #771 (Div. 2)
4. Install and deploy spark (spark on Yan mode)
C语言读取BMP文件
解决安装Failed building wheel for pillow
AI benchmark V5 ranking
數據庫高級學習筆記--SQL語句
[number theory] divisor
Cookie setting three-day secret free login (run tutorial)
Software I2C based on Hal Library
库函数--(持续更新)
express框架详解
error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_ s instead
L2-006 tree traversal (25 points)
Niuke novice monthly race 40
Software testing and quality learning notes 3 -- white box testing