I suggest to check out
http://citeseer.nj.nec.com/navarro01fast.html
The presented BNDM algorithm is one of the fastest string
searching algorithm while being easy to implement. Its main
loop is faster than the naive str_replace implementation(*).
Check out a C test implementation:
http://www.mail-archive.com/[email protected]/msg00939.html
The above paper also discusses extending the algorithm to
cover character classes (case insensitivity).
(*) I had incorporated it into PHP, if I had found a way to
nicely offset the compilation step. This proved to be the
major obstacle for small sets.
- Sascha
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php