问题
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
回答1:
You don't need more than one regular expression for this.
grep '^by.*W$' filename.txt
should suffice.
来源:https://stackoverflow.com/questions/12921217/group-more-than-one-regular-expression-in-the-same-command