当前位置:网站首页>正则表达式校验版本号
正则表达式校验版本号
2022-07-29 08:30:00 【*且听风吟】
需求:校验版本号 (规则:X.Y.Z(1-99.0-99.0-99)
)
要求:
1)必须是三位,例如:x.x.x
的形式;
2)每位x
的范围分别为1-99,0-99,0-99
;
3)不允许的情况:0.x.x,01.x.x,x.0x.x, x.00.x, x.x.00, x.x.0x
代码:
{
required: true,
pattern: /^[1-9]\d?(\.([1-9]?\d)){2}$/,
message: "版本号格式为:X.Y.Z(1-99.0-99.0-99)",
trigger: "blur"
}
校验成功的场景:
校验失败的场景:
边栏推荐
- Stm8s003 domestic substitute for dp32g003 32-bit microcontroller chip
- ROS tutorial (Xavier)
- Classic interview question: = = the difference between equals
- Reading of false news detection papers (3): semi supervised content-based detection of misinformation via tensor embeddings
- Basic crawler actual combat case: obtaining game product data
- 【OpenCV】-算子(Sobel、Canny、Laplacian)学习
- Low cost 2.4GHz wireless transceiver chip -- ci24r1
- 为了速率创建线程池,启动核心线程
- Week 1 task deep learning and pytorch Foundation
- Hal learning notes - Advanced timer of 7 timer
猜你喜欢
PostgreSQL manually creates hikaridatasource to solve the error cannot commit when autocommit is enabled
Proteus simulation based on 51 MCU ADC0808
Day5: PHP simple syntax and usage
Inclination monitoring solution of Internet of things
6.2 function-parameters
Windows 安装 MySQL 5.7详细步骤
Fastjson's tojsonstring() source code analysis for special processing of time classes - "deepnova developer community"
Simple operation of SQL server data table
[opencv] - Operator (Sobel, canny, Laplacian) learning
QT learning: use non TS files such as json/xml to realize multilingual internationalization
随机推荐
The computer video pauses and resumes, and the sound suddenly becomes louder
Four pin OLED display based on stm32
QT learning: use non TS files such as json/xml to realize multilingual internationalization
Proteus simulation based on 51 MCU ADC0808
MySQL statement mind map
Stm8s003 domestic substitute for dp32g003 32-bit microcontroller chip
Virtual augmentation and reality Part 2 (I'm a Firebird)
pnpm install出现:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
Implementation of support vector machine with ml11 sklearn
Collation of ml.net related resources
Arfoundation Getting Started tutorial 7-url dynamically loading image tracking Library
What constitutes the smart charging pile system?
Txt plain text operation
New energy shared charging pile management and operation platform
TCP - sliding window
Chrony 时间同步
Day13: file upload vulnerability
用户身份标识与账号体系实践
Segment paging and segment page combination
DC motor speed regulation system based on 51 single chip microcomputer (use of L298)