当前位置:网站首页>regular expression
regular expression
2022-07-27 01:42:00 【Strange mushrooms】
- Regular expressions often have metacharacters
- Special characters ( Be careful : Supported tools grep egrep sed awk)
- \: Escape character , Escape special characters ,
- ^: Match the beginning of the line ,^xxxx With xxx start
- $: Match the end of the line , It's about the same as above
- .: Match break \n\r Think of any single character
- [list]: matching list A character in the list
- [^list]: Reverse it , Match any character in the list
- *: Match the front face expression 0 Times or more
- \{n\} : Match the previous subexpression n Time , example :go{2}d、'[O-9]{2}' Match two numbers
- \{n,\}: Match the preceding subexpression no less than n Time , example : go\{2,\}d、' [0-9]\{2,\}' Match two or more digits
- \{n,m\}﹔ Match the previous subexpression n To m Time , example : go\{2,3\)d、'[0-9]\{2,3\}' Match two to three digits
- Special characters ( Be careful : Supported tools grep egrep sed awk)
- Extended regular expression
- character :( Be careful : Support tools egrep、awk)
- +: Repeat one or more preceding characters
- ?: matching 0 One or more previous characters
- |: similar or,egrep -n 'a|b|c' test.txt” Command to query "a" perhaps "b" perhaps "c" character string
- (): Find group characters , Think of it as a whole
- ()+: Match multiple duplicate groups
- character :( Be careful : Support tools egrep、awk)
- example :
- Find contains i/o The characters of
- grep -n 'sh[io]rt' test.txt
- Reverse filter contains w The characters of
- grep -n '[^w]oo' test.txt
- Continuously match the specified number of times
- grep -n 'o\{2\}' test.txt
- Match the complete number
- grep -n '[0-9][0-9]*' test.txt
- Find contains i/o The characters of
边栏推荐
猜你喜欢

ESP8266 STA_ Server

Traversing binary trees in non recursive pre -, middle -, and post order

Lnmp+discuz Forum
![[ctf attack and defense world] questions about cookies in the web area](/img/96/6e91ee19343a1ddc49dc2bc94cba62.png)
[ctf attack and defense world] questions about cookies in the web area
![[ctf real question] 2018 WANGDING cup web unfinish](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[ctf real question] 2018 WANGDING cup web unfinish

系统安全及应用

Shell(10)数组和冒泡排序

软件测试面试题之网络基础

ESP8266 AP_ TCP_ Client

Mqtt protocol ----- above
随机推荐
FaceNet
动态规划(背包问题)
MTCNN
十六、awk
ESP8266 STA_ Mode
[ctf real question] 2018 WANGDING cup web unfinish
39安装 LNMP
Create a daemon
源码编译安装LAMP
31正则表达式
OJ question of sequence table
[by pass] bypass method of WAF
Ubuntu12.10安装Mysql5.5(一)
进程与计划任务管理
6、 If statement
Esp8266---json---c function library provides string functions
项目 | 实现一个高并发内存池
34iptables防火墙
Shell脚本——文件的备份,更新和回滚
Definition of array