Just FYI: Recently I found that the result of following code differs by ereg_replace() and preg_replace().
<?php $str = "abcde"; var_dump(ereg_replace("", "a", $str)); var_dump(preg_replace("//", "a", $str)); ?> Hmm... there might be other trivial BC problems apart from regex spec differences, however the ereg_replace() behaviour appears somewhat strange to me. Moriyoshi "Ilia A." <[EMAIL PROTECTED]> wrote: > Currently PHP ships with two regular expression libraries that are both > installed by default, PCRE & regex. The regex library that is responsible for > ereg_* functions is fairly old and offers a very limited functionality > compared to the PCRE library. In most cases the PCRE functions are also much > faster then the old ereg functions. > I would like to propose that we drop the old ereg library and use only > a single regular expression library, PCRE. For BC purposes I've written a > patch (see attached file), which emulates the old ereg_* functions for people > who still rely on those, using PCRE. > > This cleanup would mean we'd only need to maintain one set of regular > expression code, which as far as code goes is pretty complex as well as give > speed-up for people still using ereg. > Perhaps, at some future point this would allow us to drop the ereg_* functions > all together. > > Ilia -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php