Pattern recognition in C (wanted)
Gary S. Moss (AMXBR-VLD-V)
moss at Brl-Vld.ARPA
Thu Jan 24 04:07:11 AEST 1985
~ A recent posting to net.lang.c of a "shell style" pattern matching
~ routine by Gary Moss appeared to be incomplete so I decided to post
~ an alternate.
Now Fred, this makes me nervous, the posted routine was written for
a table-of-contents lookup routine, and complete functionality a la
UNIX shell, was not critical, however I am interested in what I left
out since I am likely to find other uses for it.
~ ... By the way, it appears that the usage message
~ for matchtest is wrong. It apparently wants the arguments
~ [string pattern] rather than [pattern string].
Sorry Fred, it works as advertised, match [pattern string], if you leave
out the arguments, it reads pattern-string pairs on stdin until EOF.
YOUR match() function switches the arguments, i.e.,
BOOLEAN nmatch( string, pattern ) {...}
while mine is
int match( pattern, string ) {...}
So, if you substituted your function for mine ... :-)
Thanks for posting my sources, I should have done that originally.
__Moss__
More information about the Comp.lang.c
mailing list