[comp.sys.amiga.tech] Wildcard Support in dos.library

peter@sugar.uu.net (Peter da Silva) (02/26/89)

(moved to tech... I'm getting pretty technical here)

In article <9499@louie.udel.EDU>, AXTBF%ALASKA.BITNET@cunyvm.cuny.edu (Tim Friest - programmer at large) writes:
> I don't see where you want to do string pattern matching using the DOS
> string pattern matching patterns outside of DOS???

How about in an editor? The AmigaDOS regular expressions are, I think, fully
equivalent to the UNIX 'ed' regular expressions. That is, anything you can
express in 'ed' regexps you can express in AmigaDOS regexps. In fact, I think
they're more powerful, since they have alternation... which 'ed' doesn't.

For example, how would you specify "(if|for|while|do|switch)" in ed?

Yes, they're always fully anchored. That's probably repairable. Look at the
Software tools routines: MATCH is defined in terms of AMATCH, which is an
anchored match.

The only problem with the AmigaDOS wildcards is that the escape character
(literal quote character: "*" in AmigaDOS, "\" in UNIX, and "@" in the Software
Tools book) is overloaded by DOS as a synonym for Input() and Output(). It's
not too late to switch to the more common backslash in the next release of
DOS. Almost no third-party programs implement it anyway, so there's room to
set a better standard... one which is more likely to be followed.
-- 
Peter "Have you hugged your wolf today" da Silva  `-_-'  Hackercorp.
...texbell!sugar!peter, or peter@sugar.uu.net      'U`