当前位置:网站首页>Shell script - regular expression
Shell script - regular expression
2022-07-28 06:55:00 【Fish fire loach】
shell Script —— Regular expressions
One 、 Overview of regular expressions
1、 The concept of regular expression
It is usually used to judge , Used to check whether a string satisfies a certain format
Regular expressions are divided into basic regular expressions and extended regular expressions
It's not a tool program , It's a standard basis for string processing
Search with a single string 、 Match a series of strings that conform to a certain syntax rule
It consists of ordinary characters (a~z), And special characters ( Also called “ Metacharacters ”) form
Ordinary characters include upper and lower case letters 、 Numbers 、 Punctuation and some other symbols
Metacharacters refer to special characters with special meaning in re regular expressions , It can be used to specify its leading characters ( The character before the metacharacter ) The occurrence pattern in the target object
2、 Supported by regular expressions Linux Text processing tools

#grep and awk Apply to extended regular expressions
grep -E
awk -r
3、 Common characters in basic regular expressions
Supported tools :grep、egrep、sed、awk

4、 Extended regular expression metacharacter

5、 Regular Expression Matching E-mail Address
user name @
^([a-zA-Z0-9_-.+]+)@
subdomain
([a-zA-Z0-9_-.]+)
Top-level domain name
.([a-zA-Z]{2,5})$
a-zA-Z0-9_-.]+)
Top-level domain name
.([a-zA-Z]{2,5})$
边栏推荐
- Analysis of the semaphore source code of AQS
- 手把手教你三步完成测试监控系统搭建
- HDU-5805-NanoApe Loves Sequence(思维题)
- [C language] dynamic memory management
- Difference between process and thread
- ---栈&队列---
- What's a good gift for Tanabata? Niche and advanced product gift recommendation
- Ubuntu18.04 set up redis cluster [learning notes]
- Implementation of simple address book in [c language]
- Technology sharing | how to simulate real use scenarios? Mock technology to help you
猜你喜欢

VMware Workstation 配置net模式
![[c language] - step by step to achieve minesweeping games](/img/ee/49ddfcd948ccd5c8c9dec3c48c6112.png)
[c language] - step by step to achieve minesweeping games

Technology sharing | common proxy tools for interface testing

Which brand of air conduction earphones is good and highly praised

防火墙——iptables防火墙(四表五链、防火墙配置方法、匹配规则详解)

DNS域名解析服务

Ten thousand words summarize and realize the commonly used sorting and performance comparison

NFS shared storage service

Yapi vulnerability hanging horse program chongfu.sh processing

FTP服务
随机推荐
Software testing (concept)
CentOS7部署MySQL数据库服务器
单项链表的创建、遍历以及按要求查找结点
遍历 二叉树
Qgraphicsview promoted to qchartview
OSI seven layer model
Ten thousand words summarize and realize the commonly used sorting and performance comparison
[realize the simple version of minesweeping games]
技术分享 | 如何模拟真实使用场景?mock 技术来帮你
mongo ssl 配置实战
[C language] dynamic memory management
Common models in software development
Which is the best air conduction Bluetooth headset? Air conduction Bluetooth headset ranking
Si Han talks about the professional development of testers
网络——网络层
Test interview questions collection (V) | automated testing and performance testing (with answers)
Tcp/ip five layer model
Gerapy use
archery数据库审核平台部署
VMware Workstation 配置net模式