I am trying to use grep with a regex to find lines in a file that match 1 of 2 possible strings. Here is my grep:
$ grep "^ID.*(ETS|FBS)" my_file.txt
The above grep returns no results. However if I execute either:
$ grep "^ID.*ETS" my_file.txt
or
$ grep "^ID.*FBS" my_file.txt
I do match specific lines. Why is my OR regex not matching? Thanks in advance for the help!
egrep
instead ofgrep -E
. – Riccardo Murri Sep 30 '11 at 13:19