lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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