正则表达式

基本正则表达式
基本正则表达式( 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

相关推荐
爬山算法9 分钟前
Redis(128)Redis的跳表(Skip List)是如何实现的?
数据库·redis·list
a***131410 分钟前
保姆级JavaWeb项目创建、部署、连接数据库(tomcat)
数据库·tomcat·firefox
z***751517 分钟前
PostgreSQL 查看数据库及表中数据占用空间大小
数据库·postgresql·oracle
橘子真甜~17 分钟前
C/C++ Linux网络编程5 - 网络IO模型与select解决客户端并发连接问题
linux·运维·服务器·c语言·开发语言·网络·c++
晚枫~23 分钟前
不同浏览器在Windows和Mac上的跨域配置方法
windows·macos
霖0034 分钟前
ZYNQ——ultra scale+ IP 核详解与配置
服务器·开发语言·网络·笔记·网络协议·tcp/ip
e***749535 分钟前
Nginx 常用安全头
运维·nginx·安全
oushaojun243 分钟前
Linux内核KGDB进阶:源码级调试实战演练(转)
linux·运维·kgdb
船长㉿1 小时前
vim常用命令
linux·编辑器·vim
Wang's Blog1 小时前
MySQL: 安装MySQL示例数据库Sakila的完整流程与技术要点
数据库·mysql