Group more than one regular expression in the same command
-
07-07-2021 - |
题
How to group two regular expression in one command
example if have a file like:
age22
Helwan University Engineering Faculty
ITI-intake33
bye FOr NOW
i am mahmoud 34
mie 4
a
And I want to search for the line that start with by and end with W ???
Using grep command
解决方案
You don't need more than one regular expression for this.
grep '^by.*W$' filename.txt
should suffice.
不隶属于 StackOverflow