regex - sed regex命令输出以html结尾的行?

标签 regex linux bash unix sed

我需要一个 sed 正则表达式命令,它会在一段时间内输出以“html”结尾且不以“a”开头的每一行。

我当前的代码可以工作吗?

sed 's/\[^a]\*\.\(html)\/p' text.txt

最佳答案

sed 命令是

sed -n '/^[^a].*html$/p'

但是打印匹配行的规范命令是grep:

grep '^[^a].*html$'

关于regex - sed regex命令输出以html结尾的行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58442520/

相关文章:

javascript - 正则表达式精确匹配字符串中的多个字符串

Linux Cronjob 不执行

java -version 返回错误,但 bash 配置文件正确

python - 将python中的键盘输入捕获为Linux中的守护进程

服务器上的 Git 初始设置 fatal error : Out of memory, realloc 失败

regex - 你见过最长的正则表达式是什么

java - 前瞻性正则表达式产生意外组

python - 仅当找到多个模式时才匹配正则表达式(python)

python - Bash 或 Python : How to download a single specified file from Github?

python - 在 Bash 中使用 Python Shell