Bug #53288 [Csd->Bgs]: "Compilation failed" on certain pcre patterns in preg_replace

From: Date: Wed, 10 Nov 2010 20:17:02 +0000
Subject: Bug #53288 [Csd->Bgs]: "Compilation failed" on certain pcre patterns in preg_replace
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-155926@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53288&edit=1

 ID:                 53288
 Updated by:         cataphract@php.net
 Reported by:        ysu at ysumail dot com
 Summary:            "Compilation failed" on certain pcre patterns in
                     preg_replace
-Status:             Closed
+Status:             Bogus
 Type:               Bug
 Package:            PCRE related
 Operating System:   win7
 PHP Version:        5.3.3
 Block user comment: N



Previous Comments:
------------------------------------------------------------------------
[2010-11-10 05:00:56] ysu at ysumail dot com

Um, I think I've overlooked that hyphen, my apologies.

------------------------------------------------------------------------
[2010-11-10 04:53:21] ysu at ysumail dot com

Description:
------------
Trying the code, it'll give you this warning:

Warning: preg_replace() [function.preg-replace]: Compilation failed:
range out of order in character class at offset 6 in
D:\www\integraCMS\scripts\testOffset.php on line 4


However, if you shuffle the characters around it'll not happen.

Test script:
---------------
<?php

$value = "this @ is . a _ test-string";
$value = preg_replace('#[^\w_-.@]#','',$value);
echo $value;

?>



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



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53288&edit=1


Thread (3 messages)

« previous php.bugs (#155926) next »