当前位置:网站首页>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
边栏推荐
- 带手续费买卖股票的最大利益[找DP的状态定义到底缺什么?]
- LeetCode SQL 197. 上升的温度
- OC-NSDictionary
- 反射课后习题及做题记录
- (Part of it is not understood, and the notes are not completed) [Graph Theory] Difference Constraints
- 【暑期每日一题】洛谷 P1255 数楼梯
- 论文《Deep Multifaceted Transformers for Multi-objective Ranking in Large-Scale E-commerce Recommender》
- 修改apt-get源为国内镜像源
- Facebook社媒营销的5大技巧,迅速提高独立站转化率!
- 企业实训复现指导手册——基于华为ModelArts平台的OpenPose模型的训练和推理、基于关键点数据实现对攀爬和翻越护栏两种行为的识别、并完成在图片中只标注发生行为的人
猜你喜欢

速看!PMP新考纲、PMBOK第七版解读

埋点开发流程

【CNN回归预测】基于matlab卷积神经网络CNN数据回归预测【含Matlab源码 2003期】

张驰课堂:六西格玛培训工具——箱线图

(2022牛客多校五)B-Watches(二分)

File upload vulnerability (2)

Vscode connect to remote server "Acquiring the lock on the/home / ~ 'problem

21 days learning challenge 】 【 sequential search
![(Part of it is not understood, and the notes are not completed) [Graph Theory] Difference Constraints](/img/e0/385579fc8657db8b175318bd739908.gif)
(Part of it is not understood, and the notes are not completed) [Graph Theory] Difference Constraints

Analysis of GCC compiler technology
随机推荐
倍福使用AdsRemote组件实现和C#的ADS通讯
【暑期每日一题】洛谷 P1551 亲戚
【机器学习】实验3布置:贝叶斯垃圾邮件识别
查看端口号占用
速看!PMP新考纲、PMBOK第七版解读
PMP新考纲考试内容介绍
查看僵尸进程
OC-NSString
自然语言处理 文本预处理(上)(分词、词性标注、命名实体识别等)
实例032:反向输出II
Wuhan 2022 organizing of the high-performance computing added new ecological development of high-performance computing
optional
根据一个字段的内容去更新另一个字段的数据,这样的sql语句该怎么样书写
59:第五章:开发admin管理服务:12:MongoDB的使用场景;(非核心数据,数据量比较大的非核心数据,人脸照片等隐私的小文件;)
gdalinfo: error while loading shared libraries: libgdal.so.30: cannot open shared object file: No su
有关 sql中的 concat()函数问题,如何拼接
自然语言处理 文本预处理(下)(张量表示、文本数据分析、文本特征处理等)
数据库概论之MySQL表的增删改查2
【ROS基础】map、odom、base_link、laser 的理解 及其 tf 树的理解
Day 4 of HCIP