[comp.lang.c] C wildcard routines

LMD101@PSUVM.BITNET (Matthew Day) (08/09/89)

Hi,
   I'm writing a program that attempts to search through a table(array) of
names, and pulls out the names according to a wildcard specification.  The
kind of wildcards I want to use are the typical ones such as '*', '?', etc.
Unfortunately my wildcard matching routines aren't working very well.  I was
wondering if anyone had some C source code they could point me to that handles
wildcards?  My program and I thank you!

Matt Day
lmd101@psuvm.bitnet

wetter@cup.portal.com (Pierce T Wetter) (08/11/89)

   
   The Gnu project has code to do wildcard stuff, you can look at that for 
info. Of course, then any program you write using that code you have to
include the GNU stuff as well, so be careful.

Pierce

P.S.  Yay!!!! I'm back! Did you miss me! Let's hear it for Portal (TM).

    I now work for Radius Inc. (The Macintosh Monitor Types). 
    By the way, all opinions are still mine, not Radius.

Confidential to Caltech Types: Send me Mail you weinies!

amanda@intercon.uu.net (Amanda Walker) (08/12/89)

In article <21181@cup.portal.com>, wetter@cup.portal.com (Pierce T Wetter)
writes:
>    The Gnu project has code to do wildcard stuff, you can look at that for 
> info. Of course, then any program you write using that code you have to
> include the GNU stuff as well, so be careful.

Another place to look is a set of routines written by Henry Spencer at
the University of Totonto.  They match UNIX-style regular expressions,
and all he asks is that you don't misrepresent where you got the code.
None of the GNU political baggage.  They came across comp.sources.unix
some time ago--they should be available for FTP from uunet or other
archive sites.

--
Amanda Walker
InterCon Systems Corporation
amanda@intercon.uu.net    |    ...!uunet!intercon!amanda

"It can hardly be a coincidence that no language on earth has ever
produced the expression 'As pretty as an airport.'"
    --Douglas Adams

earleh@eleazar.dartmouth.edu (Earle R. Horton) (08/12/89)

In article <1359@intercon.UUCP> amanda@intercon.uu.net (Amanda Walker) writes:
...
>Another place to look is a set of routines written by Henry Spencer at
>the University of Totonto.  They match UNIX-style regular expressions,
>and all he asks is that you don't misrepresent where you got the code.
>None of the GNU political baggage.  They came across comp.sources.unix
>some time ago--they should be available for FTP from uunet or other
>archive sites.

     A good place to look is j.cc.purdue.edu.  The directory is
comp.sources.unix, and you want files regexp.Z and regexp2.Z.  These
are compressed shar files, if memory serves me well.

     I have used these to do regular expression searching on the Mac,
and they work well.  They are even "16-bit clean," by this meaning
they will compile and run when used with a compiler where (sizeof(int) == 16).
That is most definitely not the case with some of the GNU code.

Earle R. Horton

rht@smsdpg.uu.net (Randy Thompson) (08/13/89)

From article <14989@dartvax.Dartmouth.EDU>, by earleh@eleazar.dartmouth.edu (Earle R. Horton):
> In article <1359@intercon.UUCP> amanda@intercon.uu.net (Amanda Walker) writes:
> ...
>>Another place to look is a set of routines written by Henry Spencer at
>>the University of Totonto.  They match UNIX-style regular expressions,

[deleted]

> comp.sources.unix, and you want files regexp.Z and regexp2.Z.  

You will also want the files regexp3.Z and regexp4.Z. These files contain
additional patches to the original code.

It is definately available from the uunet archives.
_________________________________________________________________________
Randy Thompson                                          uunet!smsdpg!rht
SMS Data Products Group, Inc.                                -  or  -   
703/648-9400                                             rht@smsdpg.UUCP
_________________________________________________________________________

guido@piring.cwi.nl (Guido van Rossum) (08/17/89)

In case you're looking for things that match the (Bourne) shell's
pattern matching rather than more elaborate ed/vi/grep style regular
expression matching (Henry Spence actually approximates egrep regular
expressions), I wrote such code years ago which I am still willing to
give away for free, no strings attached.  I recently fixed it to
support the System V-ism of [!...] to match any character not in the
set.
--
Guido van Rossum, Centre for Mathematics and Computer Science (CWI), Amsterdam
guido@cwi.nl or mcvax!guido or guido%cwi.nl@uunet.uu.net
"Repo man has all night, every night."

davidsen@sungod.crd.ge.com (ody) (08/19/89)

In article <8338@boring.cwi.nl> guido@piring.cwi.nl (Guido van Rossum) writes:
| In case you're looking for things that match the (Bourne) shell's
| pattern matching rather than more elaborate ed/vi/grep style regular
| expression ...

  You might as well post them to alt.sources. A few days ago I posted a
routine I wrote years ago for CP/M. Rich Salz had one he wrote which he
posted, and praised at great length as fast, clean, etc. You might as
well post yours, too.

	bill davidsen		(davidsen@crdos1.crd.GE.COM)
  {uunet | philabs}!crdgw1!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me