当前位置:网站首页>Reg regular expression learning notes
Reg regular expression learning notes
2022-04-22 23:50:00 【Wang Lin wlin】
Reg Regular expression learning notes
One 、 brief introduction
Regular expressions , Also known as regular expression .( English :Regular Expression, In code it is often abbreviated as regex、regexp or RE), A concept of computer science . Regular expressions are often used for retrieval 、 Replace those that match a pattern ( The rules ) The text of .
Many programming languages support string manipulation with regular expressions . for example , stay Perl A powerful regular expression engine is built in . The concept of regular expression was originally developed by Unix Tool software in ( for example sed and grep) Popular . Regular expressions are usually abbreviated to “regex”, The singular number has regexp、regex, The plural is regexps、regexes、regexen.
Two 、 Usage rule

\d | matching 0-9 Any number in , Equivalent to [0-9]
\D | Match non numeric characters , Equivalent to [^0-9]
\w | Match any letter 、 Number or underscore , Equivalent to [^A-Za-z0-9_]
\W | With any non alphabetic 、 Match numbers or underscore characters , Equivalent to [^A-Za-z0-9_]
\s | Matches any whitespace characters , Including Spaces 、 tabs 、 Page identifier , Equivalent to ?[\f\n\r\t\v]
\S | Matches any non-whitespace characters , Equivalent to [^\f\n\r\t\v]
\n | Match newline
\r | Match a carriage return
\t | Match the match
\v | Match vertical tabs
\f | Match page breaks
These characters have special meanings in regular expressions , such as :*,+,?,\,
\ | Escape character , Mark the next character as a special character
^ | Match the beginning of the string
$ | Match the end of the string
-
| Zero or more matches the preceding character or subexpression
-
| Matches the preceding character or subexpression one or more times
? | Matches the preceding character or subexpression zero or once
. | “ spot ” Matching elimination “\r\n” Any single character other than
| | or
[ ] | Character set
( ) | grouping , To match parenthesis characters , Please use “(” ? or “)”
A finite character is also called a quantifier , Is used to indicate the number of characters to match .
‘’ | Zero or more matches the preceding character or subexpression
‘’ | Matches the preceding character or subexpression one or more times
? | Matches the preceding character or subexpression zero or once
{n} | n Is a non negative integer , Matched definite n Time
{n,} | n Is a nonnegative integer , Match at least n Time
{n,m} | n and m Is a nonnegative integer , among n<=m; Match at least n Time , at most m Time
Location characters are also called character boundaries , Tags match not characters but positions that meet certain conditions , So the positioning character is “ Zero width ”.
^ | Match the beginning of the string , To begin
$ | Match the end of the string , End of expression
\b | Matches a word boundary
Focus on Ringo , Keep updating !!!*,°:.*( ̄▽ ̄)/$:.°* .
版权声明
本文为[Wang Lin wlin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204222343206113.html
边栏推荐
- MySQL索引的语法是什么
- OpenCv入门(二)——仿射变换和透视变换
- 51 单片机学习_4-1 数码管显示
- Vscode uses emmylua plug-in to debug unity project tolua code
- 80386 compilation_ Introduction to global description table GDT
- FPGA(五)RTL代码之一(跨时钟域设计)
- VsCode使用EmmyLua插件调试Unity工程ToLua代码
- 【年度总结】继往开来:回首不靠谱的2021,希冀靠谱的2022
- stm32f103 独立看门狗
- Online fox U3D client game configuration loading failed couldn't connect to server
猜你喜欢

Vscode uses emmylua plug-in to debug unity project tolua code
![[day22] - [linked list] intersecting linked list](/img/ce/703cd6a123019e9cda6eddadab6f2c.png)
[day22] - [linked list] intersecting linked list

【Turtle表白合集】“海底月是天上月,眼前人是心上人。”余生多喜乐,长平安~(附3款源码)

Install vs2017 plug-in glsl language integration V0 under Windows 7 10.120. Vsix reported an error: Microsoft visualc. redist. twelve
![[* ctf2022] Web Topic reproduction and WP](/img/b2/baaa8a0170d787a7585e7463c9a4f8.png)
[* ctf2022] Web Topic reproduction and WP

【毅力挑战】PCIe 每日一问一答(2022.03 归档)

2022年官网下安装ActiveMQ最全版与官网查阅方法

Invite you to participate in the ume plug-in development competition

PCIe reference clock architecture

LabVIEW controls computer shutdown, hibernation, logout and restart
随机推荐
Want others to watch your video? Comment on your video? It's enough to learn these two moves
LabVIEW实现应用程序停止或退出
FPGA(五)RTL代码之一(跨时钟域设计)
stm32f103 独立看门狗
在windows7下安装vs2017插件 GLSL language integration v0.10.120.vsix报错:microsoft.visualc.redist.12
Django connects to the database to obtain data
How can Cassandra, an open source database giant, tell a "new story" in China without talking about the track and the tuyere
Interpretation of UVM source code, uvm-1.2 code review notes
Traceup | a powerful tool to reduce stress and achieve more success and help you get rid of work anxiety
Django指定数据库的时候报No module named ‘django_test.settings‘
共轭梯度法(Conjugate Gradients)(4)
项目实训-小鬼僵尸
2022硬刚PLUS德施曼年度峰会:多款领航旗舰发布,引领高端市场
unbuntu18. 04 installing gamit10 71 problem solution
ssh: connect to host 172.31.8.132 port 22: Connection refused
[note] PCIe ltssm status transition
No module named 'Django is reported when Django specifies the database_ test. settings‘
程序设计语言基础(1)
【经验分享】分享 MangoPapa 的论文学习经验
JUC 全套(1)