No subject
Thu Apr 25 10:42:02 EDT 2019
In basic regular expressions the metacharacters ?, +, {,
}, |, (, and ) lose their special meaning; instead use the
backslashed versions \?, \+, \{, \}, \|, \(, and \).
So does grep '^\(fee\|fie\)' junk.txt work?
On Tue, Sep 02, 2003 at 11:35:48AM -0400, Ken Gosier wrote:
> Greetings, and I hope this isn't a "D'oh!" question that will make me kick
> myself.. :-)
>
> I wanna use grep to match on lines in a file that begin with either of 2
> patterns. As far as I understand regex's, I should use ^(...|...) to do
> this, as in:
>
> grep ^(fee|fie) junk.txt
...
> --
> Ken Gosier
> ken at kg293.net
> ken_gosier at yahoo.com
--
Mike Small
smallm at panix.com
More information about the Discuss
mailing list