Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!oliveb!amiga!cbmvax!daveh From: daveh@cbmvax.UUCP (Dave Haynie) Newsgroups: comp.sys.amiga Subject: Re: pattern matching library for 1.4 Message-ID: <6538@cbmvax.UUCP> Date: 7 Apr 89 20:07:39 GMT References: <1250@microsoft.UUCP> Organization: Commodore Technology, West Chester, PA Lines: 27 in article <1250@microsoft.UUCP>, w-colinp@microsoft.UUCP (Colin Plumb) says: > Henry Spencer wrote an excellent regular expression library you may wish > to use. (It's used in at least one Microsoft product!) > -Colin (uunet!microsoft!w-colinp) For DiskSalv V1.40, I wrote two pattern matching routines that, barring any bugs, handle all AmigaDOS regular expression metacharacters. It's only about 1.5k of C code, maybe a bit less; not sure that alone would be a reasonable library, though something similar would certainly be a good thing for two calls in a new version of an existing library. For something as generally useful as the reasonably standard UNIX regular expression matchers, you'd need a few new functions, like perhaps something that will explicitly anchor a pattern at the beginning, and another at the end, of a particular string. When you're matching filenames, you generally are asking the question "does this entire string match this pattern". There are other uses, such as the command "give me the largest string that matches this pattern", etc. I'll probably post the pattern matching code I did before too long. If anyone has any sort of verification suite for AmigaDOS patterns, I'd be interested. -- Dave Haynie "The 32 Bit Guy" Commodore-Amiga "The Crew That Never Rests" {uunet|pyramid|rutgers}!cbmvax!daveh PLINK: D-DAVE H BIX: hazy Amiga -- It's not just a job, it's an obsession