Path: utzoo!yunexus!oz From: oz@yunexus.UUCP (Ozan Yigit) Newsgroups: comp.unix.wizards Subject: Re: what should egrep '|root' print? (syntax/semantics) Keywords: regular-expressions Message-ID: <857@yunexus.UUCP> Date: 18 Sep 88 00:48:20 GMT Article-I.D.: yunexus.857 References: <44414@beno.seismo.CSS.GOV> <68203@sun.uucp> <8202@alice.UUCP> <410@quintus.UUCP> <8209@alice.UUCP> Reply-To: oz@yunexus.UUCP (Ozan Yigit) Organization: York U. Computing Services - Magic Group Lines: 31 [Apologies to those getting tired of this topic.] In article <8209@alice.UUCP> andrew@alice.UUCP (Andrew Hume) writes: > >it sounds appealing to allow a missing RE to mean the empty string > but i am unconvinced as to its utility. > With all due respect, the argument of "utility" except in the "specific" case of '|foo' (as used by Rick@seismo) is suspect (bogus?). Unless I am mistaken in the equivalence of (foo)? and (foo|E), the issue reduces to one of expression syntax vs semantics. Is there a good syntactic reason not to allow (foo|) as a valid expression, such as grammar ambiguity ?? If NOT, I would claim that the parsers rejecting the expression are "incomplete" (some would say broken :-), regardless of whether it is in "sam" (Gwyn special, Argumentum Ad Sam) or wherever. I agree that "blah(foo||bar)gasp" may not look quite as interesting (arguably) as "blah(foo|bar)+ptui", but if they are equivalent (yeah, I know, gasp is not equivalent to ptui. :-) and if there is no solid syntactic reason to allow one and disallow other, then, why bother to come up with excuses for it ?? Any thoughts, and/or some real reason against (foo|) ?? 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