Newsgroups: comp.unix.wizards
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: what should egrep '|root' print? (syntax/semantics)
Message-ID: <1988Sep22.174344.14753@utzoo.uucp>
Organization: U of Toronto Zoology
References: <44414@beno.seismo.CSS.GOV> <68203@sun.uucp> <8202@alice.UUCP> <410@quintus.UUCP> <8209@alice.UUCP> <857@yunexus.UUCP> <1988Sep20.043728.20198@utzoo.uucp> <454@quintus.UUCP>
Date: Thu, 22 Sep 88 17:43:44 GMT

In article <454@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes:
>Why not use (* ... ) as the meta-construct?

The trouble is that the word brackets aren't always used together, so the
trailing bracket needs to be distinguishable by itself.  (* is attractive,
but it has no obvious counterpart to be the closing bracket.

>It is *already* the case that programs which generate patterns have to
>go out of their way to avoid far too many magic sequences; a library like
>this would eliminate the problem at the source.

Actually, with my regexp package it suffices to backslash all the ordinary
characters.  A bit crude, but it works.  This is one of the reasons why I
am very reluctant to assign special meaning to any backslashed characters.
-- 
NASA is into artificial        |     Henry Spencer at U of Toronto Zoology
stupidity.  - Jerry Pournelle  | uunet!attcan!utzoo!henry henry@zoo.toronto.edu