当前位置:网站首页>正则及常用公式
正则及常用公式
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位类似了。
边栏推荐
- [Lua] summary of common knowledge points (including common interview sites)
- flume 190 INSTALL
- PCL 投影点云
- 记录 AttributeError: ‘NoneType‘ object has no attribute ‘nextcall‘
- PCL 点云转深度图像
- 13.信号量临界区保护
- sqoop创建job出现的一系列问题解决方法
- Internet News: Tencent conference application market was officially launched; Soul went to Hong Kong to submit the listing application
- UVM learning - build a simple UVM verification platform
- (五)APA场景搭建之挡位控制设置
猜你喜欢

使用sqlcipher打开加密的sqlite方法

【TS】1368- 秒懂 TypeScript 泛型工具类型!

STM32 and motor development (upper system)

Pytest framework implements pre post

nodejs+express+mysql简单博客搭建

Flink submitter

Rapid prototyping

拆解美图SaaS:开着飞机换引擎
![2.hacking-lab脚本关[详细writeup]](/img/f3/29745761cd5ad4df84c78ac904ea51.png)
2.hacking-lab脚本关[详细writeup]
![[visual studio] visual studio 2019 community version cmake development environment installation (download | install relevant components | create compilation execution project | error handling)](/img/9f/4265f1e3927fcf66602f0fc9e7a9d9.jpg)
[visual studio] visual studio 2019 community version cmake development environment installation (download | install relevant components | create compilation execution project | error handling)
随机推荐
[SUCTF2018]followme
Database dictionary Navicat automatic generation version
UWA报告使用小技巧,你get了吗?(第四弹)
Record attributeerror: 'nonetype' object has no attribute 'nextcall‘
SQOOP 1.4.6 INSTALL
The nanny level tutorial of flutter environment configuration makes the doctor green to the end
Analysis of hot spots in AI technology industry
Operator-1初识Operator
618 what is the secret of dominating the list again? Nike's latest financial report gives the answer
Internet News: Tencent conference application market was officially launched; Soul went to Hong Kong to submit the listing application
Test -- Summary of interview questions
[SUCTF2018]followme
[jetbrain rider] an exception occurred in the construction project: the imported project "d:\visualstudio2017\ide\msbuild\15.0\bin\roslyn\microsoft.csh" was not found
Win11 arm系统配置.net core环境变量
flume 190 INSTALL
Thanos Receiver
快速做出原型
UVM learning - build a simple UVM verification platform
Open the encrypted SQLite method with sqlcipher
集成学习概览