Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!rphroy!tkacik From: tkacik@rphroy.ph.gmr.com (Tom Tkacik) Newsgroups: comp.sys.3b1 Subject: Re: egrep on the 3b1 is weird! Message-ID: <48545@rphroy.UUCP> Date: 22 Mar 91 19:33:11 GMT References: <1268@hico2.UUCP> <8783@gollum.twg.com> <1311@hico2.UUCP> Sender: news@rphroy.UUCP Reply-To: tkacik@rphroy.ph.gmr.com (Tom Tkacik) Organization: GM Research, Warren, Mi Lines: 20 Nntp-Posting-Host: link.ph.gmr.com In article , guest@geech.ai.mit.edu (Guest Account) writes: |> Since without any kind of quoting or special chars a regular |> expression is 1 character: |> egrep 'foo|bar' |> matches lines containing fooar and fobar. That's why you need to use |> parentheses. You have to read the manual page for ed(1) to get the |> rest of the story on regular expressions. To quote the grep man page: Sorry, try again. Concatenation has higher precedence than '|'. egrep 'foo|bar' will match either foo or bar, not fobar nor fooar. egrep works like that here at work. I have not yet tried it at home. I will. If it works as Kris A. Kugel says, then it must be busted. -- Tom Tkacik tkacik@clyde.cs.gmr.com GM Research Labs tkacik@kyzyl.mi.org "I'm president of the United States, and I'm not going to eat anymore broccoli." --- George Bush