wildcard matching

Mark A Terribile mat at mole-end.UUCP
Tue Jan 1 14:34:42 AEST 1991


(On the subject of wildcard patterns whose match is pathalogical in time ...)

> I think that the recursive call is unnessicary.  Consider that anything
> trailing the '*' character is ignored anyway, at least in MS-DOS, and
> OS/2. What need is there for further checking if a '*' character is
> encountered?  Does that hold true in the UNIX would too?

In UNIX, the `*' is NOT limited to matching a whole name component, but
instead any sequence of characters, anywhere.  Thus, one can write

	a*b*c

If you want to guarantee efficient matching, then I think you have to generate
a DFSA.  If you want to come close, you can put some pathology checks in your
code (like `*' after `*').  And there are publicly available regex-like
matchers, most of which will want .* for a closure on an arbitrary character.
Some of them might not be too hard to change.
-- 

 (This man's opinions are his own.)
 From mole-end				Mark Terribile



More information about the Comp.lang.c mailing list