[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Boyer-Moore string search?
- From: Klaus Ripke <paul-lua@...>
- Date: Mon, 28 Apr 2008 11:51:34 +0200
On Fri, Apr 25, 2008 at 09:44:50PM -0400, Norman Ramsey wrote:
> I wonder if anybody happens to have a Boyer-Moore string-search
> engine coded up for Lua? My application is parsing MIME email
> messages, so I wind up searching repeatedly for the same string,
> and some of the messages are very large, so I want the sublinear
> performance you get with Boyer-Moore.
If GPL is ok for you I'd suggest to use the Commentz-Walter
implementation from GNU fgrep (part of the grep package).
If you are interested I can send you a simplified one-file version
without the dependencies on other parts of the grep package
(especially their memory allocation stuff).
I did not actually write a Lua binding, but that would require
only a few lines...
regards
Klaus