egrep on the 3b1 is weird!

Kris A. Kugel kak at hico2.UUCP
Sat Mar 23 19:07:21 AEST 1991


> > In article <1268 at hico2.UUCP> kak at 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,
> 
> Now, I could see from this [manual] description that maybe the
> pattern I tried would match  "fo[bo]ar", but that was NOT the
> behavior I remember seeing.  


Well, evidently the problem is not as simple as I described it.
I'd used the "foo|bar" example as a substitute phrase for what
I was really trying.  Bruce Lilly tried this literally with a
good sample file, and with this simple case egrep seems to work
correctly.  And his test works correctly on my machine, too.

If I recall correctly, I saw the (I say) incorrect behavior
when I trying to find a newsarticle about some subject
(I didn't remember the title or group exactly, so
I had an "egrep -i "pat1|pat2|pat3|pat4|pat5|pat6|pat7|pat9"
kind of thing, probably running on stdin.)
I saw the malfunction, looked at a couple of (false match) lines,
and thought "these could be explained by . . ." without
doing a comprehensive check.

It sounds like I'm going to have to find a test case
showing this problem exactly, because it's CLEARLY not
the straightforward malfunction that I described in my
original article.  (*sigh* when I get time . . . .)

I'd also conclude that I should have been more accurate
and complete about the conditions under which I saw the
problem, and presented the "[fb][oa][or]" explanation
as a hypothesis, rather than as the observed problem.
I'll try to be more accurate in the future.
                               Kris A. Kugel
                             ( 908 ) 842-2707
                      uunet!tsdiag.ccur.com!hico2!kak
                        {daver,ditka,zorch}!hico2!kak
                      internet: kak at hico2.westmark.com



More information about the Comp.sys.3b1 mailing list