Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!granite.pa.dec.com!mwm From: mwm@raven.pa.dec.com (Mike (Real Amigas have keyboard garages) Meyer) Newsgroups: comp.sys.amiga.tech Subject: Re: Regular expressions vs. file name generation (Was: Re: Pipes) Message-ID: Date: 16 Jun 90 23:43:11 GMT References: <2533@zipeecs.umich.edu> <136735@sun.Eng.Sun.COM> <12391@cbmvax.commodore.com> <36467@sequent.UUCP> Sender: news@wrl.dec.com (News) Organization: Missionaria Phonibalonica Lines: 36 In-Reply-To: cseaman@sequent.UUCP's message of 8 Jun 90 23:38:49 GMT In article <36467@sequent.UUCP> cseaman@sequent.UUCP (Chris "I'm Outta Here, Man!" Seaman) writes: daveh@cbmvax.commodore.com (Dave Haynie) writes: < As pointed out many times here before, the Amiga regular expression language < is far more powerful than the other models available at the time. Now you're < really the one talking syntactic sugar. Sure, "*" could be substituted for < "#?", but what do you substitute for FILE#(A|B|C#E??).(C|O), or a similar While I don't want to sound critical (I LIKE the regular expression syntax on the Amiga!), I feel that SOME of the more intelligent UNIX shells have been slightly slighted (?). Although the Bourne shell could not match the power of the above statement, csh and ksh can. I would implement it in csh as follows: ls file{[ab],c{e*,}??}.[co] Sorry, that doesn't quite cut it. Dave's pattern will match fileaa.c, but that won't. The c{e*,}?? is also broken. ls file*([ab]|c*(e)??).[co] This one works - because ksh has extended it's pattern matching language to look more like real regular expressions (but the operator on subexpressions is still on the wrong end of the subexpression!). BTW, I hadn't realized that ksh had been so extended. Thanks for pointing it out.