当前位置:网站首页>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 '
}
}
};
边栏推荐
- Nanny level problem setting tutorial
- AcWing 179.阶乘分解 题解
- 【CDH】CDH/CDP 环境修改 cloudera manager默认端口7180
- ES6 let 和 const 命令
- Vs2019 desktop app quick start
- When you open the browser, you will also open mango TV, Tiktok and other websites outside the home page
- QT creator create button
- {一周总结}带你走进js知识的海洋
- 02 staff information management after the actual project
- 库函数--(持续更新)
猜你喜欢

Word排版(小计)

2019腾讯暑期实习生正式笔试

Double to int precision loss
![[Blue Bridge Cup 2017 preliminary] grid division](/img/e9/e49556d0867840148a60ff4906f78e.png)
[Blue Bridge Cup 2017 preliminary] grid division

Software I2C based on Hal Library

Vs2019 desktop app quick start

Machine learning -- census data analysis

PHP - whether the setting error displays -php xxx When PHP executes, there is no code exception prompt

Vs2019 first MFC Application

Request object and response object analysis
随机推荐
Learn winpwn (2) -- GS protection from scratch
解决安装Failed building wheel for pillow
ES6 promise object
nodejs 详解
Error connecting to MySQL database: 2059 - authentication plugin 'caching_ sha2_ The solution of 'password'
Codeforces Round #753 (Div. 3)
MySQL与c语言连接(vs2019版)
Wangeditor rich text component - copy available
【Flink】CDH/CDP Flink on Yarn 日志配置
vs2019 使用向导生成一个MFC应用程序
express框架详解
wangeditor富文本组件-复制可用
L2-004 is this a binary search tree? (25 points)
L2-006 树的遍历 (25 分)
Word排版(小计)
Codeforces Round #771 (Div. 2)
Niuke novice monthly race 40
Learning question 1:127.0.0.1 refused our visit
Pytorch基础
[蓝桥杯2020初赛] 平面切分