当前位置:网站首页>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
边栏推荐
- 【机器学习】实验2布置:基于回归分析的大学综合得分预测
- SQL server 2014 怎么一次性导出多个查询结果?
- Splunk Filed Alias 字段改名
- 论文《Deep Multifaceted Transformers for Multi-objective Ranking in Large-Scale E-commerce Recommender》
- [21天学习挑战赛——内核笔记](一)——设备树的概述(硬件、目标、效果、文件类型)
- 论文阅读 (64):Weakly-supervised Video Anomaly Detection with Robust Temporal Feature Magnitude Learning
- 【暑期每日一题】洛谷 P1551 亲戚
- awk语法-01-基础语法(命令、选项、内部变量)
- CSRF-跨站请求伪造-相关知识
- 59:第五章:开发admin管理服务:12:MongoDB的使用场景;(非核心数据,数据量比较大的非核心数据,人脸照片等隐私的小文件;)
猜你喜欢

入门opencv,欢笑快乐每一天
——设备树的概述(硬件、目标、效果、文件类型)](/img/c6/6c2321bfcd184886e1cb59664bec11.png)
[21天学习挑战赛——内核笔记](一)——设备树的概述(硬件、目标、效果、文件类型)

正则表达式

awk语法-01-基础语法(命令、选项、内部变量)

Splunk Filed Alias 字段改名

FaceBook社媒营销高效转化技巧分享

论文《Deep Multifaceted Transformers for Multi-objective Ranking in Large-Scale E-commerce Recommender》

Neo4j 中文开发者月刊 - 202207期

2022.07.31(LC_6132_使数组中所有元素都等于零)

【故障诊断分析】基于matlab FFT轴承故障诊断(包络谱)【含Matlab源码 2002期】
随机推荐
Neo4j 中文开发者月刊 - 202207期
docker 安装mysql
(2022牛客多校五)D-Birds in the tree(树形DP)
带手续费买卖股票的最大利益[找DP的状态定义到底缺什么?]
根据一个字段的内容去更新另一个字段的数据,这样的sql语句该怎么样书写
gdalinfo: error while loading shared libraries: libgdal.so.30: cannot open shared object file: No su
企业实训复现指导手册——基于华为ModelArts平台的OpenPose模型的训练和推理、基于关键点数据实现对攀爬和翻越护栏两种行为的识别、并完成在图片中只标注发生行为的人
新产品立大功 伟世通第二季度营收双增
“蔚来杯“2022牛客暑期多校训练营4,签到题NDKHL
【心电信号】基于matlab心率检测【含Matlab源码 1993期】
jvm 二之 栈帧内部结构
交换--STP协议
LeetCode 2360. 图中的最长环
图腾柱和推挽电路介绍
(Part of it is not understood, and the notes are not completed) [Graph Theory] Difference Constraints
实例027:递归输出
【CV】OpenVINO安装教程
[Dataset][VOC] Male and female dataset voc format 6188 sheets
数据库概论之MySQL表的增删改查1
CollectionUtil:一个函数式风格的集合工具