Re: Feature Request #5919 case-insensitive version of str_replace()
| From: | Sascha Schumann | Date: | Wed, 29 Jan 2003 21:06:09 +0000 |
| Subject: | Re: Feature Request #5919 case-insensitive version of str_replace() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-93776@lists.php.net to get a copy of this message | ||
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/dev@httpd.apache.org/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