ahocorasick

pecl install ahocorasick

Effective Aho-Corasick string pattern matching algorithm

PHP extension implementing Aho-Corasick pattern matching algorithm (more on wiki).

Is especially effective if there is a large database of needles (=strings to be searched, for example virus
signatures). Another advantage is that built search structure is initialized before search in separate call thus
it can be called more times with different haystack, saving time.

Computing Aho-Corasick in th native code (PHP extension) rather than in a pure PHP manner gives this
implementation significant performance boost.

Maintainer

  • Dusan Klinec (lead )

Details

Stars: 47
Issue openned: 1
Downloads: 31664
0.0.7
5 years ago
Version 0.0.7 change log


Issue #21 fixed. Problem with buffering all previous searches in the trie.

requires:

  • php >=5.2.0<=7.3.99
  • pearinstaller >=1.4.0b1