当前位置:网站首页>正则及常用公式
正则及常用公式
2022-07-02 07:13:00 【LHT-2787】
正则基本符号
^:起始符号,^x表示以x开头
$:结束符号,x$表示以x结尾
[n-m]:表示从n到m的数字
\d:表示数字,等同于[0-9]
X{m}:表示由m个X字符构成
身份证
18位身份证的构成:六位出生地区码+八位出生日期码+三位顺序码+一位校验码
isIDCard=/^[1-9]\d{
5}[1-9]\d{
3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{
4}$/;
[1-9]\d{5}:六位出生地区码,出生地区码没有以0开头,因此第一位为[1-9]。
[1-9]\d{3}:八位出生日期码的四位年份,同样年份没有以0开头。
((0\d)|(1[0-2])):八位出生日期码的两位月份,| 表示或者,月份的形式为0\d或者是10、11、12。
(([0|1|2]\d)|3[0-1]):八位出生日期码的两位日期,日期由01至31。
\d{4}:三位顺序码+一位校验码,共四位。
15位身份证的构成:六位出生地区码+六位出身日期码+三位顺序码
isIDCard=/^[1-9]\d{
7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{
3}$/;
[1-9]\d{7}:六位出生地区码+两位出生日期码的年份,这里的年份指后两位,因此没有第一位不能为0的限制,所以合并了。
后面的与18位类似了。
边栏推荐
- 面对不确定性,供应链的作用
- "Matching" is true love, a new attitude for young people to make friends
- How to get the password of cpolar?
- axis设备的rtsp setup头中的url不能带参
- VLAN experiment
- [visual studio] every time you open a script of unity3d, a new vs2017 will be automatically reopened
- [TS] 1368 seconds understand typescript generic tool types!
- PCL 投影点云
- 对话吴纲:我为什么笃信“大国品牌”的崛起?
- Webui automated learning
猜你喜欢
Postman -- use
Operator-1初识Operator
Leetcode+ 76 - 80 storm search topic
[Fantasy 4] the transformation from U3D to UE4
Ks009 implement pet management system based on SSH
[MySQL] an exception occurs when connecting to MySQL: connection must be valid and open
使用sqlcipher打开加密的sqlite方法
Pytest-- test report allure configuration
flink 提交程序
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
随机推荐
Is this code PHP MySQL redundant?
JS reduce accumulator
Session cookies and tokens
Flink实时计算topN热榜
Flutter环境配置保姆级教程,让doctor一绿到底
Internet News: Tencent conference application market was officially launched; Soul went to Hong Kong to submit the listing application
Understand the composition of building energy-saving system
Open the encrypted SQLite method with sqlcipher
SQOOP 1.4.6 INSTALL
The URL in the RTSP setup header of the axis device cannot take a parameter
[unity3d] cannot correctly obtain the attribute value of recttransform, resulting in calculation error
集成学习概览
js setTimeout()与面试题
02-taildir source
PCL之K-d树与八叉树
传输优化抽象
flume 190 INSTALL
高考的意义是什么
[tutorial] how to make the Helpviewer help document of VisualStudio run independently
[SUCTF2018]followme