当前位置:网站首页>Regular Expression
Regular Expression
2022-07-19 05:16:00 【azenlijing】
PCRE
- . Normally matches any character except a newline. Within square brackets the dot is literal.
- ( ) Groups a series of pattern elements to a single element. When you match a pattern within parentheses, you can use any of $1, $2, … later to refer to the previously matched pattern.
- ? Matches the preceding pattern element zero or one time.
- ? Modifies the *, +, ? or {M,N} regex that comes before to match as few times as possible.
- * Matches the preceding element zero or more times.
- {M,N} Denotes the minimum M and the maximum N match count. N can be omitted and M can be 0: {M} matches “exactly” M times; {M,} matches “at least” M times; {0,N} matches “at most” N times. x* y+ z? is thus equivalent to x{0,} y{1,}, z{0,1}.
- […] Denotes a set of possible character matches.
- | Separates alternate possibilities.
- \b Matches a zero-width boundary between a word-class character and either non-word class character or an edge; same as (^\w|\w$|\W\w|\w\W).
- \w Matches an alphanumeric character, including “_”; same as [A-Za-z0-9_] in ASCII.
- \W Matches a non-alphanumeric character, excluding “_”; same as [^A-Za-z0-9_] in ASCII.
- \s Matches a whitespace character, which in ASCII are tab, line feed, form feed, carriage return, and space.
- \S Matches anything but a whitespace.
- \d Matches a digit; same as [0-9] in ASCII.
- \D Matches a non-digit; same as [^0-9] in ASCII.
- ^ Matches the beginning of a line or string.
- $ Matches the end of a line or string.
- [^…] Matches every character except the ones inside brackets.
lookahead
(?=regex)
(?!regex)
lookbehind
(?<=regex)
(?<!regex)
边栏推荐
- Leshan normal programming competition 2020-b: design web page [prime number]
- (data and electricity) summary of various triggers - FPGA octet (1)
- Definition, calculation method and relationship among linear convolution, cyclic convolution and periodic convolution
- RS232 standard DB9 interface definition
- 雷达基础知识
- 统计实验数据命名,数据命名规则like:d8i8.txt
- Software engineering final review mind map
- 详细讲解JS中的加法(+)运算,基本数据类型相加,引用数据类型相加底层的运算规则,[]+{},{}+[]
- 2021-09-30
- How to put a "platform" into a small box? (I) scheme comparison
猜你喜欢
使用Google colab进行机器学习的经验
Detailed explanation of the principle of triode series linear voltage stabilizing circuit and Multisim Simulation
TCP three handshakes and four swings
Infrared decoding program based on timer capture function (NEC protocol)
网络安全学习(十一)扫描与爆破
2022 -7-18 第八小组 顾宇佳 学习笔记
Many new features of ktor2.0 were thought of a year ago and have been implemented in the project
Network Security Learning (XVII) VLAN
Secure Code Warrlor学习记录(三)
Least square linear fitting and its code implementation (C language)
随机推荐
使用小技巧(一)
FPGA skimming p1:1-out-of-4 multiplexer, asynchronous reset Series T trigger, parity check, shift splicing multiplication
FPGA - detailed explanation of SPI bus (concept)
my homework 模板 latex版本
NJU南京大学高程课设:坦克大战(BattleCity)
使用google cloud部署基于flask的网站
Panzer_Jack 的 个人博客成立日
Precautions for the selection and conversion of single power supply operational amplifier and dual power supply operational amplifier and their power supply mode
第三次实验 ospf
FPGA skimming p2: multifunctional data processor, calculate the difference between two numbers, use generate For statement simplifies the code, uses sub modules to realize the size comparison of three
计算机408+数据库【适合考研复试或期末复习】
Understanding of arm interrupt priority
FPGA decoder + decoder (including code)
Leetcode:13. Roman numeral to integer [key value pair mapping]
离散数据(数组)的过零位置搜索
Vulnhub target earth
Code audit system
Network Security Learning (XIX) HSRP protocol
The third "intelligence Cup" National College Students' IT skills competition (solution to group B of the preliminary competition)
使用gem5在fft上进行测试beta版本