Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!motcsd!xdos!doug From: doug@xdos.UUCP (Doug Merritt) Newsgroups: comp.sources.wanted Subject: Re: pattern matching Keywords: pattern matching Message-ID: <308@xdos.UUCP> Date: 18 May 89 21:15:01 GMT References: <2414@cveg.uucp> <10288@smoke.BRL.MIL> Reply-To: doug@xdos.UUCP (Doug Merritt) Organization: Hunter Systems, Mountain View CA (Silicon Valley) Lines: 29 In article <10288@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <2414@cveg.uucp> mhb@hcx.uucp (MARK H BOTNER) writes: >>Can anybody help me with pattern matching? I'm trying to match >>a string against a pattern such as '*' or '*.*' in the same manner that >>the 'ls' command uses. >That should be extremely easy, as "ls" does no pattern matching. Nitpick. Where's your ":-)" ? Substitute "sh" for "ls". Besides, maybe he's using MS-DOS, in which case it might really be "ls" that's doing the matching he's used to. >>I've tried regex and regexp and I've even downloaded regex.Z from >>uunet.uu.net, but none of these work like I want. >Gee, they ought to. Not really...as I recall, they implement ed/ex/vi/sed-syntax patterns such as "." and ".*", where he wants "?" and "*". Though you'd think it'd be easy to modify that regexp.Z source to use the desired syntax. I have a C routine that does pattern matching, but it, too, is not strictly compatible with "sh" so that probably wouldn't help. Doug -- Doug Merritt {pyramid,apple}!xdos!doug Member, Crusaders for a Better Tomorrow Professional Wildeyed Visionary