From:             [EMAIL PROTECTED]
Operating system: Linux (Debian)
PHP version:      4.0.4pl1
PHP Bug Type:     PCRE related
Bug description:  preg_replace("/([_%&])/","\\\\1",$text) does not work as expected

I want to replace _ with \_, % with \% and & with \&.

Under PHP4.0.3pl1 (tested) and lower the following Code worked as expected:
$text = "Test with_ and %";
$text = preg_replace("/([_%&])/","\\\\1",$text);
echo $text;

But under PHP4.0.4pl1 the output is:
Test with\\1 and \\1

PHP is compiled as Module with Apache.

Thank you,

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to