From: [EMAIL PROTECTED]
Operating system: FreeBSD 4.2
PHP version: 4.0.5
PHP Bug Type: POSIX related
Bug description: ereg_replace fails on strings containing backslashes
The goal is to replace sequence of two backslashes in $text by one
backslash. While preg_replace works, ereg_replace does not make any change
to $text.
echo "preg_replace\n";
$text="\\\\";
echo "--".$text."--".strlen($text)."\n";
$text=preg_replace( "/\\\\\\\\/", "\\\\", $text);
echo "--".$text."--".strlen($text)."\n";
echo "\n";
echo "ereg_replace\n";
$text="\\\\";
echo "--".$text."--".strlen($text)."\n";
$text=ereg_replace( "\\\\\\\\", "\\\\", $text);
echo "--".$text."--".strlen($text)."\n";
./configure \
--with-mysql=/usr/local/mysql \
--with-imap=/usr/ports/new/imap \
--enable-track-vars \
--enable-trans-sid
--
Edit bug report at: http://bugs.php.net/?id=15203&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]