Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!texbell!sugar!peter From: peter@sugar.hackercorp.com (Peter da Silva) Newsgroups: comp.sys.amiga.tech Subject: Re: Wildcards Message-ID: <5405@sugar.hackercorp.com> Date: 18 Mar 90 18:55:35 GMT References: <102618@linus.UUCP> Reply-To: peter@sugar.hackercorp.com (Peter da Silva) Organization: Sugar Land Unix - Houston Lines: 34 In article <102618@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes: > I am surprised at the use of the phrase "more powerful amiga-style wildcards". > More powerful than what? More powerful than on UNIX. The Amiga wildcards provide a complete implementation of regular expressions, with closures. UNIX wildcards don't. Suppose you want to match all file names ending with .c, .h, or .bak, and beginning with an underscore or "ck" or containing the string "test". In UNIX, you have to use several expressions: _*.[ch] _*.bak ck*.[ch] ck*.bak *test*.[ch] *test*.bak On the Amiga, you have a single expression: ((_|ck)#?|#?test#?).(c|h|bak) Or you can do the same thing in egrep: \(\(_|ck\).*|.*test.*\).\([ch]|bak\) The Amiga wildcards are more complex, but they're also a lot more powerful. > I never understood where the AmigaDos wildcard conventions came from. The syntax is unconventional, but the use of a closure rather than a wildcard has been around for a long time. -- _--_|\ Peter da Silva . / \ \_.--._/ I haven't lost my mind, it's backed up on tape somewhere! v "Have you hugged your wolf today?" `-_-'