当前位置:网站首页>regular expression
regular expression
2022-07-22 21:27:00 【Ten at eight】
1、 Regular expressions and wildcards
Regular expressions are used to match qualified strings in a file , Include matching when regular .grep,awk,sed Regular expressions can be supported by commands such as .
Wildcards are used to match the file names that match the criteria , The wildcard is an exact match .ls,find,cp These commands do not support regular expressions , So you can only use shell Their own wildcards to match .
2、 Basic regular expressions
Metacharacters | effect |
* | The previous character matches 0 Times or any number of times |
. | Match any character except newline |
^ | Match the beginning of the line . for example :^hello Will match to hello Beginning line |
$ | Match the end of the line . for example :hello& Will match to hello Line ending with |
[] | Matches any character specified in brackets , Match only one character . for example :[aoeiu] Match any vowel ,[0-9] Match any digit ,[a-z][0-9] Match two characters consisting of lowercase letters and one digit . |
[^] | Match any character except the character in bracket . for example :[^0-9] Match any non numeric character ,[^a-z] Any non lowercase letter . |
\ | Escape character . Used to cancel the meaning of special symbols . |
\{n\} | Indicates that the character preceding it happens to appear n Time . for example :[0-9]\{4\} matching 4 Digit number ,[1][3-8][0-9]\{9\} Match cell phone number . |
\{n,\} | Indicates that the character before it is not less than n Time . for example :[0-9]\{2,\} Two or more digits |
\{n,m\} | Indicates that the character preceding it appears at least n Time , Most appear m Time . for example :[a-z]\{6,8\} matching 6 To 8 The lower case letter of bit . |
边栏推荐
猜你喜欢
JUC-6.2-并发容器-CopyOnWriteArrayList
BUUCTF闯关日记--[极客大挑战 2019]HardSQL1
BUUCTF闯关日记--[网鼎杯 2020 青龙组]AreUSerialz
Human stars website collection plan -- Michael kerrisk
Chapter 4: Minio's pre signed URLs upload files
人类群星网站收集计划--Michael Kerrisk
[lttng learning journey] ----- components of lttng deconstruction
[pytorch deep learning practice] learning notes section 4 back propagation
第二章:给项目配置数据源,redis,security,swagger等工具jar
第七章:使用jwt token的方式来进行登录
随机推荐
如何做好研发精益需求管理
Juc-8.0-future and callable
Buuctf entry diary -- [nctf2019]fake XML Cookbook
流程控制—if语句
(七)vulhub专栏:Log4j远程代码执行漏洞复现
Chapter 1: Minio introduction and installation
[lttng learning journey] - environment construction
Problems and solutions of using libsvm-3.23 in matlab2017a environment
BUUCTF闯关日记--[网鼎杯 2020 青龙组]AreUSerialz
BUUCTF闯关日记04--[ACTF2020 新生赛]Include1
Bash basic functions alias and shortcut keys
4.文本编辑器
1.虚拟化和容器技术
Pytoch automatic derivation
pkg-config 查找库和用于编译
第二章:给项目配置数据源,redis,security,swagger等工具jar
Buctf passing Diary - - [Netting Cup 2020 Qinglong Group] areuserialz
[LTTng学习之旅]------Trace控制--进阶
Buuctf breakthrough diary 04 -- [actf2020 freshman competition]include1
[lttng learning journey] - trace control -- advanced