Path: utzoo!yunexus!oz From: oz@yunexus.UUCP (Ozan Yigit) Newsgroups: comp.unix.wizards Subject: Re: what should egrep '|root' /etc/passwd print? (Everything) Keywords: regular-expressions, egrep, gnu-egrep Message-ID: <855@yunexus.UUCP> Date: 15 Sep 88 14:59:07 GMT Article-I.D.: yunexus.855 References: <44414@beno.seismo.CSS.GOV> <8492@smoke.ARPA> Reply-To: oz@yunexus.UUCP (Ozan Yigit) Organization: York U. C. S. Impressive-Sounding-Name Labs. Lines: 32 In article <8492@smoke.ARPA> Doug Gwyn writes: >In article <44414@beno.seismo.CSS.GOV> Rick Adams writes: >>What should >> egrep '|root' /etc/passwd >>print? > >The question of how to handle empty strings in regular expressions >does not have a clear-cut answer. Oh ??? Just what does '(foo)?' match on your egrep ?? It just happens to be the same thing as E|foo (E for Epsilon, or the null match), or exactly what rick wants to match. It had a clear cut answer before, but I am sure it is lost somewhere along the line. > .."sam", which has the most powerful >regular expression mechanism of any of the editor-like programs I use, >says the following: > ?no operand for `|' A parsing glitch no doubt. See, some expressions are more regular :-) then others, so "sam" will no doubt accept the expression under a disguise of "(foo)?". In any case, Rick should probably use jaw-improved-gnu-egrep for correct results. oz -- Crud that is not paged | Usenet: ...!utzoo!yunexus!oz is still crud. | ...uunet!mnetor!yunexus!oz andrew@alice | Bitnet: oz@[yulibra|yuyetti] | Phonet: +1 416 736-5257x3976