Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!tgr!moss@Brl-Vld.ARPA From: "Gary S. Moss (AMXBR-VLD-V)" Newsgroups: net.lang.c Subject: Re: Pattern recognition in C (wanted) Message-ID: <7658@brl-tgr.ARPA> Date: Wed, 23-Jan-85 13:07:11 EST Article-I.D.: brl-tgr.7658 Posted: Wed Jan 23 13:07:11 1985 Date-Received: Fri, 25-Jan-85 07:59:06 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 21 ~ 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__