PHP 4.0 Bug #10038 Updated: preg_replace("/([_%&])/","\\\\1",$text) does not work as expected
| From: | andrei@php.net | Date: | Wed, 28 Mar 2001 17:17:12 +0000 |
| Subject: | PHP 4.0 Bug #10038 Updated: preg_replace("/([_%&])/","\\\\1",$text) does not work as expected | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-50152@lists.php.net to get a copy of this message | ||
ID: 10038
Updated by: andrei
Reported By: reeg-pb@junetz.de
Old-Status: Open
Status: Closed
Bug Type: PCRE related
Assigned To:
Comments:
This is fixed in 4.0.5.
Previous Comments:
---------------------------------------------------------------------------
[2001-03-28 12:14:47] reeg-pb@junetz.de
Hello,
I want to replace _ with _, % with % and & with &.
Under PHP4.0.3pl1 (tested) and lower the following Code worked as expected:
<?php
$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,
Christoph
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10038&edit=2