Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!psuvax1!psuvm!uh2 From: UH2@psuvm.psu.edu (Lee Sailer) Newsgroups: comp.sys.amiga.programmer Subject: Re: Source code for search Message-ID: <91158.180643UH2@psuvm.psu.edu> Date: 7 Jun 91 22:06:42 GMT References: <492@regina.uregina.ca> Organization: Penn State University Lines: 14 >> Would anyone happen to have source code for a (very) fast search routine? >> Basically, what I need is something like strstr(), but I need to be able >> to modify it to make it non-case sensitive. I'm basically looking through >> a small (512-2048 bytes) buffer for an ASCII string. >> If you mean what I think you mean, you probably want Boyer-Moore search. There is probably source for it buried deep in a copy of egrep, or somewhere, but I'm too lazy to dig it out. You could look in a good data structures book---I think Sedgewick covers it. Another likely source would be a compiler book. Look in the chapter that covers token parsing. There are techniques where you compile your search string into a FSM, and then run it using the buffer as the tape.