Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!tandem!zorch!hico2!kak From: kak@hico2.UUCP (Kris A. Kugel) Newsgroups: comp.sys.3b1 Subject: Re: egrep on the 3b1 is weird! Summary: kak reacts in an annoyed fashion to part of dsh's reply. kak still thinks egrep is broken. Keywords: egrep unix-pc 3b1 Message-ID: <1311@hico2.UUCP> Date: 21 Mar 91 23:04:03 GMT References: <1268@hico2.UUCP> <8783@gollum.twg.com> Organization: High Country Software Lines: 51 > <- David Herron, an MMDF & WIN/MHS guy, In article <8783@gollum.twg.com>, david@twg.com (David S. Herron) writes: > In article <1268@hico2.UUCP> kak@hico2.UUCP (Kris A. Kugel) writes: > >Am I confused, or does egrep on the 3b1 > >handle multiple regular expressions incorrectly? > > > > egrep 'foo|bar' > > > >seems to match '[fb][oa][or]' patterns, > >instead of what I wanted (matching lines with "foo" or "bar") > > Try > > egrep '(foo)|(bar)' I'll try this, thanks for the method. > And read the F'ing manual a little more closely next time ... No need to get hostile, I did after your message. Carefully. It says, "3. Two regular expressions separated by | or by a new line match strings that are matched by either. 4. A regular expression may be enclosed in parentheses () for grouping. The order of precedence of operators is [], then * ? + , then concatenation, then | and new-line." Now, if you want to complain that I missed something obvious and well documented, fine. If what you describe is really how the feature is designed, then I claim that that is NOT obvious from the description on the manual page. Now, I could see from this description that maybe the pattern I tried would match "fo[bo]ar", but that was NOT the behavior I remember seeing. I claim that either the manual page is very poorly written, or else what I tried should have given me CLEARLY different results than I got. Now, to find the egrep on osu-cis . . . . Kris A. Kugel ( 908 ) 842-2707 uunet!tsdiag.ccur.com!hico2!kak {daver,ditka,zorch}!hico2!kak internet: kak@hico2.westmark.com