← All Projects
aho_corasick

aho_corasick

ExampleOpen SourceFork

The Aho-Corasick algorithm, published in 1975 by Alfred Aho and Margaret Corasick, solves the problem of searching a text for any of a set of pattern strings simultaneously. Rather than running a separate pass for each keyword, it builds a finite automaton from all patterns at once and scans the input in a single linear pass — making it far faster than naive repeated searching when the keyword set is large.

This C++ fork of cjgdev's implementation provides a library suitable for embedding in projects that need high-performance multi-pattern text matching.