当前位置:网站首页>Want to go whoring in vain, right? Enough for you this time!
Want to go whoring in vain, right? Enough for you this time!
2022-07-25 12:37:00 【Front end technology stack】

Enjoy it , Develop good habits ! Collection society , The rolling king is not tired ~
in addition 1 Small tips, Students who have trouble with regular reading can use this website jex.im/regulex/, Visualize regular , From then on, I fell in love with reading regular !
such as : Verify the regularity of the mailbox :
^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$
After Visualization , Just look at the picture and talk , Xiaobai metropolis , True drop tql !!
Okay , Rush !
Number related
cell-phone number ( With 1 start ):/^(?:(?:\+|00)86)?1\d{10}$/ cell-phone number ( With 13 to 19 start ):/^(?:(?:\+|00)86)?1[3-9]\d{9}$/ cell-phone number ( Start with the mobile phone number segment published by the Ministry of industry and information technology ):/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/ Domestic fixed line number :/\d{3}-\d{8}|\d{4}-\d{7}/ Mail box number :/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/ Postal Code :/[1-9]\d{5}(?!\d)/ ID number :/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/ Bank card number ( Male 、 Private account ):/^[1-9]\d{9,29}$/ license plate number :/^[ Beijing, Tianjin, Shanghai, Chongqing, Hebei, Henan, Yunnan, Liaoning, Heilongjiang, Hunan, Anhui, Shandong, new Jiangsu, Zhejiang, Jiangxi, Hubei, Guangxi, Gansu, Shanxi, Inner Mongolia, Shaanxi, Jilin, Fujian, Guizhou, Guangdong, Qinghai Tibet, Sichuan, Ningxia and Hainan ][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9 Hang the school police in Hong Kong and Macao ]$/ QQ Number :/^[1-9][0-9]{4,10}$/ WeChat ID :/^[a-zA-Z][-_a-zA-Z0-9]{5,19}$/ Version number ( x.y.z ):/^\d+(?:\.\d+){2}$/ Legal account 1( Beginning of letter ,5-16 position , Allow alphanumeric underscores ):/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/ Legal account 2(4-16 position , Allow letters , Numbers , Underline , minus sign ):/^[a-zA-Z0-9_-]{4,16}$/ Strong password 1( Must contain a combination of upper and lower case letters and numbers , Special characters cannot be used , The length is in 8-10 Between ):/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$/ Strong password 2( Must contain letters 、 Numbers 、 Special characters :**@#$%^& `~()-+=* ): /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\[email protected]#$%^&* ~()-+=]+$)(?![a-z0-9]+$)(?![a-z\\[email protected]#$%^& *~()-+=]+$)(?![0-9\[email protected]#$%^&* ~()-+=]+$)[a-zA-Z0-9\\[email protected]#$%^&*~()-+=]/ website :/^(((ht|f)tps?):\/\/)?(^[email protected]#$%^&*?.\s-?\.)+[a-z]{2,6}\/?/ The website has a port number :/^((ht|f)tps?:\/\/)?[\w-]+(\.[\w-]+)+:\d{1,5}\/?$/ ip-v4:/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b/ ip-v6:/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/
Numbers are relevant
Only numbers :/^[0-9]*$/ or /^\d{1,}$/ Integers :/^-?[0-9]\d*$/ Positive integer :/^\+?[1-9]\d*$/ Non positive integer :/^-[1-9]\d*|0$/ Negtive integer :/^-[1-9]\d*$/ Non-negative integer :/^\d+$/ Floating point numbers :/^(-?\d+)(\.\d+)?$/ Positive floating point :/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$/ Negative floating point number :/^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)/ decimal :/^-?\d+\.\d+$/ Positive numbers / negative / decimal :/^(\-|\+)?\d+(\.\d+)?$/ Positive real numbers are kept after the decimal point 2 position :/^[0-9]+(.[0-9]{2})?$/ Positive real numbers are kept after the decimal point 1 To 3 position :/^[0-9]+(.[0-9]{1,3})?$/ n Digit number :/^\d{n}$/ At least n Digit number :/^\d{n,}$/ m to n Digit number :/^\d{m,n}$/ Numbers and letters contain at least one :/^[A-Za-z0-9]+$/ Must contain numbers and letters :/^(?=.*[a-zA-Z])(?=.*\d).+$/ md5 value :/^([a-f\d]{32}|[A-F\d]{32})$/ base64 value :/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i
Character related
m to n A character :/^.{3,20}$/ Alphabetic characters :/^[A-Za-z]+$/ Capitalized English alphabetic characters :/^[A-Z]+$/ Lowercase English alphabetic characters :/^[a-z]+$/ Chinese characters :/^[\u4e00-\u9fa5]{0,}$/ Full angle symbol :/[\uFF00-\uFFFF]/ Half angle symbol :/[\u0000-\u00FF]/ Chinese characters 、 english 、 Numbers 、 Underline at least one :/^[\u4E00-\u9FA5A-Za-z0-9_]+$/ Does not contain characters “~” :/[^~\x22]+/ Characters repeat continuously :/(.)\1+/
Time related
24 Hour time (HH:mm:ss):/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/ 12 Hour time (hh:mm:ss):/^(?:1[0-2]|0?[1-9]):[0-5]\d:[0-5]\d$/ 24 Hour time (HHmmss):/([0-1]?[0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$/ date 1(yyyy-MM-dd, Such as 2222-01-01, The year must be 4 position ):/^\d{4}-\d{1,2}-\d{1,2}/ date 2( Such as 333-01-01, The year can be less than 4 position ):/^\d{1,4}(-)(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31)$/ date 3(yyyyMMdd, Such as 20220202):/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})(((0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))0229))$/ date + Time 1(YYYYMMDD HH:mm:ss):/^\d{4}([/:-\S])(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31) (?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/ date + Time 2: /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/ A year 12 Months ((01~09 or 1~12)):/^(0?[1-9]|1[0-2])$/ A month 31 God (01~09 or 1~31):/^((0?[1-9])|((1|2)[0-9])|30|31)$/ Yes 31 Day's month :/^(0?[13578]|1[02])$/ Yes 30 Days and months :/(0[469]|11)-(0[1-9]|[12][0-9]|30)/ 2 month 28 God ("02-28"):/^02-(0[1-9]|[1][0-9]|2[0-8])$/ Leap year :/^(((19|20)([13579][26]|[2468][048]|0[48]))|(2000))$/ Leap year 2 month ( such as 2008-02-01):/^(((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2-(0?[1-9]|[12]\d)$/ date ( Including leap years 、 Judgment of big and small months ):/((((19|20)\d{2})-(0?(1|[3-9])|1[012])-(0?[1-9]|[12]\d|30))|(((19|20)\d{2})-(0?[13578]|1[02])-31)|(((19|20)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2-29))$/ Year range - year ( such as 19 - 20 year ):/^((19|20)\d{2})$/ Year range - years ( such as 1999-01):/^((((19|20)\d{2})-(0?[13-9]|1[012]))|(((19|20)\d{2})-(0?[13578]|1[02]))|(((19|20)\d{2})-0?2)|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2))$/ Year range - Specific date ( such as 1999-01-01):/^((((19|20)\d{2})-(0?[13-9]|1[012])-(0?[1-9]|[12]\d|30))|(((19|20)\d{2})-(0?[13578]|1[02])-31)|(((19|20)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2-29))$/.test('2021-02-21')$/ Year range - Specific date ( The interval symbol can be - / Or empty ):/^(?:(?:1[6-9]|[2-9][0-9])[0-9]{2}([-/.]?)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:(?:1[6-9]|[2-9][0-9])(?:0[48]|[2468][048]|[13579][26])|(?:16|[2468][048]|[3579][26])00)([-/.]?)0?2\2(?:29))$/
Programming related
16 Binary color :/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/ Extract web page color code :/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/ Video link address :/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i Picture link address :/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i mac Address :/^((([a-f0-9]{2}:){5})|(([a-f0-9]{2}-){5}))[a-f0-9]{2}$/i Subnet mask :/^((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))$/ File extension validation :/^([a-zA-Z]\\:|\\\\)\\\\([^\\\\]+\\\\)*[^\\/:*?"<>|]+\\.txt(l)?$/ java Package name (x.x.x):/^([a-zA-Z_]\w*)+([.][a-zA-Z_]\w*)+$/ xml file :/^([a-zA-Z]+-?)+[a-zA-Z0-9]+\\.[x|X][m|M][l|L]$/ html notes :/<!--[\s\S]*?-->/g html label 1:/<(\w+)[^>]*>(.*?<\/\1>)?/ html label 2:/<(\S*?)[^>]*>.*?</\1>|<.*? />/ First and last white space characters :/^\s*|\s*$/ lookup CSS attribute :/^\\s*[a-zA-Z\\-]+\\s*[:]{1}\\s[a-zA-Z0-9\\s.#]+[;]{1}/ Extract page hyperlinks :/(<a\\s*(?!.*\\brel=)[^>]*)(href="https?:\\/\\/)((?!(?:(?:www\\.)?'.implode('|(?:www\\.)?', $follow_list).'))[^" rel="external nofollow" ]+)"((?!.*\\brel=)[^>]*)(?:[^>]*)>/ Take pictures of web pages :/\\< *[img][^\\\\>]*[src] *= *[\\"\\']{0,1}([^\\"\\'\\ >]*)/ Thunderbolt link :/^thunder:\/\/[a-zA-Z0-9]+=$/ ed2k link :/^ed2k:\/\/|file|.+|\/$/ linux" file " route :/^\/(\w+\/)+\w+\.\w+$/ window Next " file " route :/^[a-zA-Z]:\\(?:\w+\\)*\w+\.\w+$/
Life related
amount of money ( loose , It can be negative 、 The first can be 0, It supports thousand digit separation ):/^-?\d+(,\d{3})*(\.\d{1,2})?$/ amount of money ( Greater than 0 , Two decimal places ):/(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{2}$)/ amount of money ( Strictly , Not negative 、 Up to two digits after the decimal point , The first is not 0):/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/ passport :/(^[EeKkGgDdSsPpHh]\d{8}$)|(^(([Ee][a-fA-F])|([DdSsPp][Ee])|([Kk][Jj])|([Mm][Aa])|(1[45]))\d{7}$)/ Hong Kong Identity Card :/^[a-zA-Z]\d{6}\([\dA]\)$/ Macao identity card :/^[1|5|7]\d{6}\(\d\)$/ Wan Wan ID card :/^[a-zA-Z][0-9]{9}$/ Stock code :/^(s[hz]|S[HZ])(000[\d]{3}|002[\d]{3}|300[\d]{3}|600[\d]{3}|60[\d]{4})$/ Not included abc 's words :/\b((?!abc)\w)+\b/
Programmer interview question bank sharing
1、 Front end interview question bank ( For the interview ) recommend :*****
Address : Front end interview question bank
边栏推荐
- 软件测试面试题目:请你列举几个物品的测试方法怎么说?
- If you want to do a good job in software testing, you can first understand ast, SCA and penetration testing
- 想要做好软件测试,可以先了解AST、SCA和渗透测试
- [ROS advanced chapter] Lecture 9 programming optimization of URDF and use of xacro
- Script set random user_ agent
- Fiddler packet capturing app
- Azure Devops(十四) 使用Azure的私有Nuget仓库
- Jenkins配置流水线
- Median (two point answer + two point search)
- 【三】DEM山体阴影效果
猜你喜欢

Kyligence 入选 Gartner 2022 数据管理技术成熟度曲线报告
![[ROS advanced chapter] Lecture 9 programming optimization of URDF and use of xacro](/img/a2/9b676d0f1b33cc7d413cee6c52d76d.png)
[ROS advanced chapter] Lecture 9 programming optimization of URDF and use of xacro

Leetcode 0133. clone diagram

LeetCode 1184. 公交站间的距离

Eureka registration center opens password authentication - record

Crawler crawls dynamic website

想要做好软件测试,可以先了解AST、SCA和渗透测试

Azure Devops(十四) 使用Azure的私有Nuget仓库

搭建Vision Transformer系列实践,终于见面了,Timm库!

使用TensorBoard可视化训练过程
随机推荐
Atomic atomic class
2022.07.24(LC_6126_设计食物评分系统)
Crawler crawls dynamic website
Fault tolerant mechanism record
scrapy爬虫爬取动态网站
推荐系统-协同过滤在Spark中的实现
Pytorch project practice - fashionmnist fashion classification
A method to prevent SYN flooding attacks -- syn cookies
aaaaaaaaaaA heH heH nuN
919. 完全二叉树插入器 : 简单 BFS 运用题
The first scratch crawler
Cmake learning notes (II) generation and use of Library
3.2.1 what is machine learning?
搭建Vision Transformer系列实践,终于见面了,Timm库!
Numpy first acquaintance
perf 性能调试
Fiddler抓包APP
More accurate and efficient segmentation of organs-at-risk in radiotherapy with Convolutional Neural
Alibaba cloud technology expert Qin long: reliability assurance is a must - how to carry out chaos engineering on the cloud?
循环创建目录与子目录