Kir*_*ril 1 regex logging grep
我正在尝试分析日志文件.我正在寻找一个正则表达式,它满足以下要求:
LOG: https://localhost/a
LOG: https://remotehost/x
LOG: https://localhost/b
LOG: https://localhost/c
LOG: https://remotehost/a
Run Code Online (Sandbox Code Playgroud)
以上是日志文件的示例.问题:如何通过日志文件进行grep,这样我只得到不包含的行:
https://localhost
Run Code Online (Sandbox Code Playgroud)
结果应该是:
LOG: https://remotehost/x
LOG: https://remotehost/a
Run Code Online (Sandbox Code Playgroud)
使用 grep -v <word> <filename>
从grep手册(FreeBSD):
-v, --invert-match
Invert the sense of matching, to select non-matching lines.
Run Code Online (Sandbox Code Playgroud)