当前位置:网站首页>regular expression
regular expression
2022-07-26 09:46:00 【44w0】
1. qualifiers :(“ ?”,“ + ”,“ * ”)
?: The characters decorated in the front need to appear 0 Time or 1 Time , Modifier characters are optional
*: Characters decorated in front , appear 0 Times or times
+ : Decorated characters , appear 1 More than once
If you specify the number of modifier characters : ab{ Number of times }c
If you specify the number of occurrences of modifier characters, the range is [3,5]:ab{3,5} c
If you specify the number of occurrences of modifier characters, the range is 3 To infinity :ab{3,} c
–> If you decorate multiple characters Enclosed in brackets
namely : (ab){2,}c
2. or |
a(b|c): matching a Behind is b perhaps c String
3. Character class [ ]
[abc]: Match by abc Words that make up
Can be in [] Specified range inside :
[a-z]: All lowercase letters
[A-Z]: All capital letters
[0-9]: All figures
[a-zA-Z0-9]: All upper and lower case letters and numbers
if [^]: Match except the ones listed after the cusp 【 outside 】 The characters of
4. Metacharacters
A series of common character types defined in regular expressions
Most of them are \ start :
\d Represents a numeric character be equal to [0-9]
\w Characters representing words ( english 、 Numbers and underscores )
\s For the blank ( contain Tab And line breaks )
\b Represents the word character boundary
\B Represents non word character boundaries
\D Represents non numeric characters
\W Represents non word characters
\S Represents a non blank character
. Arbitrary character ( Does not include line breaks )
^ Match the beginning of the line
$ Match the end of the line
5. Greed matches laziness
Greedy matching : When matching, it will match as many characters as possible by default * + {}
Laziness matches : Add another one to the right of the matching symbol ?, Switch the default greedy matching to lazy matching
边栏推荐
- QT handy notes (II) edit control and float, qstring conversion
- Redis sentinel mode setup under Windows
- Logical architecture of MySQL
- Write a script that can run in Bash / shell and PowerShell
- copyTo
- 网络流学习笔记
- Unstoppable, pure domestic PCs have been in place, and the monopoly of the U.S. software and hardware system has been officially broken
- Node 内存溢出及V8垃圾回收机制
- The whole process of server environment configuration
- mfc随手笔记
猜你喜欢
【荧光字效果】
挡不住了,纯国产PC已就位,美国的软硬件体系垄断正式被破
[datawhale] [machine learning] Diabetes genetic risk detection challenge
Alibaba cloud technology expert haochendong: cloud observability - problem discovery and positioning practice
电机转速模糊pid控制
2021年山东省中职组“网络空间安全”B模块windows渗透(解析)
v-premission添加权限
Gauss elimination
MQTT X CLI 正式发布:强大易用的 MQTT 5.0 命令行工具
2019 ICPC Asia Yinchuan regional (water problem solution)
随机推荐
学习笔记之常用数组api 改变原数组和不改变原数组的有哪些?
Table extraction for opencv table recognition (2)
EOJ 2020 January race E-number transformation
一种分布式深度学习编程新范式:Global Tensor
Mo team learning summary (II)
微信小程序图片无法显示时显示默认图片
[Online deadlock analysis] by index_ Deadlock event caused by merge
官方颁发的SSL证书与自签名证书结合实现网站双向认证
uni-app学习总结
(一)面扫描仪与机械臂的手眼标定(眼在手上)
【Datawhale】【机器学习】糖尿病遗传风险检测挑战赛
Wechat applet avatarcropper avatar clipping
Sqoop【付诸实践 02】Sqoop1最新版 全库导入 + 数据过滤 + 字段类型支持 说明及举例代码(query参数及字段类型强制转换)
Why does new public chain Aptos meet market expectations?
MFC handy notes
The whole process of server environment configuration
电机转速模糊pid控制
Malloc failed to allocate space and did not return null
POJ 1012 Joseph
反射机制的原理是什么?