what should egrep '|root' print? (syntax/semantics)

Ozan Yigit oz at yunexus.UUCP
Sun Sep 18 10:48:20 AEST 1988


[Apologies to those getting tired of this topic.]

In article <8209 at alice.UUCP> andrew at 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 at 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 at alice		| Bitnet: oz@[yulibra|yuyetti]
				| Phonet: +1 416 736-5257x3976



More information about the Comp.unix.wizards mailing list