ID: 8741
Updated by: cynic
Reported By: [EMAIL PROTECTED]
Old Status: Closed
Status: Bogus
Bug Type: PCRE related
Operating System: Linux 2.x, Redhat 6.2
PHP Version: 4.0.3pl1


Previous Comments:
------------------------------------------------------------------------

[2001-01-16 12:56:19] [EMAIL PROTECTED]

The following code does not work properly

$number = "999.00";
$precision = 2;
echo preg_replace("/\.0{$precision}/", "", $number);

it echos 999.00

But if you escape the first `{' bracket, the regular expression works properly

echo preg_replace("/\.0\{$precision}/", "", $number);

it echos 999





------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=8741&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]

Reply via email to