正则表达式

基本正则表达式
基本正则表达式( Basic Regular Expression , BRE ),又称为标准正则表达式,是最早制订的正则表达
式规范,仅支持最基本的元字符集。基本正则表达式是 POSIX 规范制订的两种正则表达式语法标准之
一,另外一种语法标准称为扩展正则表达式。

root@shell shell\] # grep \^a /etc/passwd \[root@shell shell\] # grep h$ /etc/passwd \[root@shell shell\] # grep . /etc/passwd \[root@shell shell\] # grep ro\* /etc/passwd \[root@shell shell\] # grep "ro\\{1,2\\}" /etc/passwd \[root@shell shell\] # grep "ro\\{1\\}" /etc/passwd \[root@shell shell\] # grep \[a-zA-Z\] /etc/passwd \[root@shell shell\] # grep \[a-Z\] /etc/passwd \[root@shell shell\] # grep \[0-9\] /etc/passwd \[root@shell shell\] # grep \[0-9a-Z\] /etc/passwd 或者 grep \[\[:alnum:\]

/etc/passwd

root@shell shell\] # grep \[\[:space:\]\] /etc/passwd \[root@shell shell\] # grep \[\^a\] /etc/passwd \[root@shell shell\] # grep \^\[ab\] /etc/passwd \[root@shell shell\] # grep "\\." file \[root@shell shell\] # grep "\\(root\\).\*\\1" file \[root@shell shell\] # grep "ly\\\>" file \[root@shell shell\] # grep "\\\" file love \[root@shell shell\] # grep "\\blove\\b" file love 扩展正则 ![](https://i-blog.csdnimg.cn/direct/68c205727c3f475e94a3b1b43b60f91c.png) \[root@shell shell\] # grep -E ro? /etc/passwd \[root@shell shell\] # grep -E ro+ /etc/passwd \[root@shell shell\] # grep -E "(root\|adm\|ssh)" /etc/passwd

相关推荐
Clang's Blog1 分钟前
一键搭建 WordPress + MySQL + phpMyAdmin 环境(支持 PHP 版本选择 & 自定义配置)
数据库·mysql·php·wordpr
vortex53 分钟前
探索 Shell:选择适合你的命令行利器 bash, zsh, fish, dash, sh...
linux·开发语言·bash·shell·dash
zzc9215 分钟前
MATLAB仿真生成无线通信网络拓扑推理数据集
开发语言·网络·数据库·人工智能·python·深度学习·matlab
未来之窗软件服务26 分钟前
JAVASCRIPT 前端数据库-V1--仙盟数据库架构-—-—仙盟创梦IDE
数据库·数据库架构·仙盟创梦ide·东方仙盟数据库
GalaxyPokemon27 分钟前
LeetCode - 148. 排序链表
linux·算法·leetcode
LjQ204035 分钟前
网络爬虫一课一得
开发语言·数据库·python·网络爬虫
异常君35 分钟前
高并发数据写入场景下 MySQL 的性能瓶颈与替代方案
java·mysql·性能优化
Guheyunyi36 分钟前
监测预警系统重塑隧道安全新范式
大数据·运维·人工智能·科技·安全
烙印60139 分钟前
MyBatis原理剖析(二)
java·数据库·mybatis
RestCloud40 分钟前
如何通过ETLCloud实现跨系统数据同步?
数据库·数据仓库·mysql·etl·数据处理·数据同步·集成平台