当前位置:网站首页>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

边栏推荐
- 【荧光字效果】
- Sqoop【环境搭建 01】CentOS Linux release 7.5 安装配置 sqoop-1.4.7 解决警告并验证(附Sqoop1+Sqoop2最新版安装包+MySQL驱动包资源)
- 小白搞一波深拷贝 浅拷贝
- 解决ProxyError: Conda cannot proceed due to an error in your proxy configuration.
- Azkaban【基础知识 01】核心概念+特点+Web界面+架构+Job类型(一篇即可入门Azkaban工作流调度系统)
- Fiddler packet capturing tool for mobile packet capturing
- JS 一行代码 获取数组最大值与最小值
- IIS website configuration
- Fiddler download and installation
- 2022 zhongkepan cloud - server internal information acquisition and analysis flag
猜你喜欢
![[MySQL] understand the important architecture of MySQL (I)](/img/89/5fb595b0112fac987626857b76f9a4.png)
[MySQL] understand the important architecture of MySQL (I)

Matlab Simulink realizes fuzzy PID control of time-delay temperature control system of central air conditioning

A new paradigm of distributed deep learning programming: Global tensor

Gauss elimination solves the inverse of matrix (Gauss)

2021 windows penetration of "Cyberspace Security" B module of Shandong secondary vocational group (analysis)

Xiaobai makes a wave of deep copy and shallow copy

开发转测试:从0开始的6年自动化之路...

Qt随手笔记(三)在vs中使用QtCharts画折线图

2021年山东省中职组“网络空间安全”B模块windows渗透(解析)

Login module use case writing
随机推荐
Basic knowledge of website design
Gauss elimination
Audio and video knowledge
正则表达式
C# 托管与非托管
Network flow learning notes
解决npm -v突然失效 无反应
Node memory overflow and V8 garbage collection mechanism
JS continuous assignment operation
B站这个视频我是跪着看完的
js 表格自动循环滚动,鼠标移入暂停
copyTo
[datawhale] [machine learning] Diabetes genetic risk detection challenge
Gauss elimination for solving XOR linear equations
Process32first returns false, error x message 24
OFDM Lecture 16 - OFDM
[MySQL] understand the important architecture of MySQL (I)
配置ADCS后访问certsrv的问题
E. Two Small Strings
RMQ学习笔记