当前位置:网站首页>regular expression
regular expression
2022-08-02 07:48:00 【Classmate Peng, she is at the same table】
Character group []
[Pp]ython can match Python python, that is, a string starting with P or p followed by python[0-9] is OKMatch all numbers between 0-9[0-9a-zA-Z] is to match all numbers lowercase letters uppercase letters[^0-9] means that it will not match 0-9[/-] Match special characters such as '-' through translation characters
When you want to match multiple special characters
For example[\[|\]|\-|\(|\)]match -----()[] Split by |
The following lowercase letters are replaced by uppercase letters, which is notThe meaning of [\d] means all numbers [\D] means no matching numbers[\w] means that both upper and lower case letters can be matched[\s] means matching spaces[\bwoaini\b] means that word boundaries will only match between words and spaces, that is, the wordWoaini will not work if it is followed by other alphanumerics. Special symbols can be 
Do not add [] and write ^python directly to indicate that the python at the beginning of the matching string will not be matched again if python appears later. For example, python123python can only match the previous python
python$ means match python at the end and cannot add special symbols including spaces. can match anything except \n?n indicates that this n can appear or not appear
{3} indicates the number of repetitions 3
such as \d{3}-\d{5}
{3,4} means it can match 3 or 4 if it is {3,}Match more than 3 numbers
eg
+Equivalent to {1,}
*equivalent to {0,}
Extract
(\d{4})-(\d{7})The corresponding data can then be extracted
边栏推荐
猜你喜欢

MQ带来的一些问题、及解决方案

59:第五章:开发admin管理服务:12:MongoDB的使用场景;(非核心数据,数据量比较大的非核心数据,人脸照片等隐私的小文件;)

2022.07.31(LC_6133_分组的最大数量)

FaceBook社媒营销高效转化技巧分享
![WebGPU 导入[2] - 核心概念与重要机制解读](/img/8f/195a3b04912d8872d025df58ab5960.png)
WebGPU 导入[2] - 核心概念与重要机制解读

敏捷、DevOps和嵌入式系统测试

【图像隐藏】基于matlab混合DWT-HD-SVD数字图像水印方法技术【含Matlab源码 2007期】

Splunk Filed extraction 字段截取

Wuhan 2022 organizing of the high-performance computing added new ecological development of high-performance computing

实验7 MPLS实验
随机推荐
LeetCode Algorithm 1374. 生成每种字符都是奇数个的字符串
SQL执行顺序
【机器学习】实验3布置:贝叶斯垃圾邮件识别
mysql 注入
Go 实现分布式锁
【机器学习】实验5布置:AAAI会议论文聚类分析
Day 4 of HCIP
MySQL-FlinkCDC-Hudi实时入湖
张驰课堂:六西格玛培训工具——箱线图
OC-NSArray
带手续费买卖股票的最大利益[找DP的状态定义到底缺什么?]
[Dataset][VOC] Male and female dataset voc format 6188 sheets
飞桨paddle技术点整理
【机器学习】课程设计布置:某闯关类手游用户流失预测
实例028:递归求等差数列
【暑期每日一题】洛谷 P1192 台阶问题
自然语言处理 文本预处理(下)(张量表示、文本数据分析、文本特征处理等)
[21天学习挑战赛——内核笔记](一)——设备树的概述(硬件、目标、效果、文件类型)
OC-范畴
正则表达式