当前位置:网站首页>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
边栏推荐
- R language ggpubr package ggsummarystats function visualizes the grouping box diagram (custom grouping color) and adds the statistical values corresponding to the grouping under the x-axis label (samp
- 苹果独占鳌头,三星大举复兴,国产手机在高端市场颗粒无收
- 解决npm -v突然失效 无反应
- Table extraction for opencv table recognition (2)
- MFC handy notes
- Audio and video knowledge
- js 表格自动循环滚动,鼠标移入暂停
- 网站设计需要的基本知识
- QT随手笔记(六)——更新界面、截图、文件对话框
- [information system project manager] summary of essence of high-level series for the first time
猜你喜欢
V-permission add permission
服务器、客户端双认证(2)
MySQL的逻辑架构
【Datawhale】【机器学习】糖尿病遗传风险检测挑战赛
Registration module use case writing
【Mysql数据库】mysql基本操作集锦-看得会的基础(增删改查)
Sqoop【环境搭建 01】CentOS Linux release 7.5 安装配置 sqoop-1.4.7 解决警告并验证(附Sqoop1+Sqoop2最新版安装包+MySQL驱动包资源)
Gauss elimination
2021年山东省中职组“网络空间安全”B模块windows渗透(解析)
After attaching to the process, the breakpoint displays "currently will not hit the breakpoint, and no symbols have been loaded for this document"
随机推荐
Apple dominates, Samsung revives, and domestic mobile phones fail in the high-end market
高斯消元求解异或线性方程组
解释一下自动装箱和自动拆箱?
2019 ICPC Asia Yinchuan regional (water problem solution)
OFDM Lecture 16 - OFDM
V-permission add permission
【荧光字效果】
Table extraction for opencv table recognition (2)
面试突击68:为什么 TCP 需要 3 次握手?
网站设计需要的基本知识
SSG框架Gatsby访问数据库,并显示到页面上
阿里云技术专家郝晨栋:云上可观测能力——问题的发现与定位实践
[datawhale] [machine learning] Diabetes genetic risk detection challenge
Double authentication of server and client
2019 ICPC Asia Yinchuan Regional(水题题解)
Flutter event distribution
2021 windows penetration of "Cyberspace Security" B module of Shandong secondary vocational group (analysis)
Basic knowledge of website design
E. Two Small Strings
QT handy notes (VI) -- update interface, screenshot, file dialog box