当前位置:网站首页>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 '
}
}
};
边栏推荐
- 人脸识别 face_recognition
- Error reporting solution - io UnsupportedOperation: can‘t do nonzero end-relative seeks
- Summary of numpy installation problems
- Kept VRRP script, preemptive delay, VIP unicast details
- [mrctf2020] dolls
- QT creator specifies dependencies
- nodejs连接Mysql
- [Flink] cdh/cdp Flink on Yan log configuration
- When using lambda to pass parameters in a loop, the parameters are always the same value
- AcWing 179. Factorial decomposition problem solution
猜你喜欢

Connexion sans mot de passe du noeud distribué

AI benchmark V5 ranking

软件测试与质量学习笔记3--白盒测试

机器学习笔记-Week02-卷积神经网络

Picture coloring project - deoldify

Why can't I use the @test annotation after introducing JUnit

Rhcsa certification exam exercise (configured on the first host)

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

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

Nanny level problem setting tutorial
随机推荐
QT creator runs the Valgrind tool on external applications
QT creator custom build process
QT creator specifies dependencies
MySQL and C language connection (vs2019 version)
Neo4j installation tutorial
What does usart1 mean
PHP - whether the setting error displays -php xxx When PHP executes, there is no code exception prompt
Install mongdb tutorial and redis tutorial under Windows
Vs2019 desktop app quick start
2020网鼎杯_朱雀组_Web_nmap
[Blue Bridge Cup 2017 preliminary] buns make up
Pytorch基础
Library function -- (continuous update)
01 project demand analysis (ordering system)
SQL time injection
{一周总结}带你走进js知识的海洋
Learn winpwn (3) -- sEH from scratch
Database advanced learning notes -- SQL statement
Codeforces Round #753 (Div. 3)
[mrctf2020] dolls