Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!cornell!rochester!pt.cs.cmu.edu!andrew.cmu.edu!bader+ From: bader+@andrew.cmu.edu (Miles Bader) Newsgroups: comp.sys.amiga Subject: Re: pattern matching library for 1.4 Message-ID: Date: 5 Apr 89 21:34:25 GMT References: <12314@louie.udel.EDU> Organization: Information Technology Center, Carnegie Mellon, Pittsburgh, PA Lines: 26 In-Reply-To: <12314@louie.udel.EDU> MROBINSON@wash-vax.bbn.com writes: > I've seen lots of talk about a library for filename pattern matching > support in 1.4, but none about supporting pattern matching in strings! > > I personally would like to see, IN ADDITION to the previously mentioned > filename "parameter expansion" support, a supported call like > > find_pattern_in_string(pattern,plen,string,slen,match_start,match_len) ... If you're going to implement this, split it into separate compile-pattern and find-match calls, so that repeated invocations are faster... E.g.: struct regexp *regexp_Compile(pattern); char *pattern; int /* boolean */ regexp_Match(re,str,strlen,matchP,matchlenP) struct regexp *re; char *str; int strlen; char **matchP; /* out parameter, or NULL if not needed */ int *matchlenP; /* out parameter, or NULL if not needed */ -Miles