ID:               37600
 Updated by:       [EMAIL PROTECTED]
 Reported By:      iain at iaindooley dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         PCRE related
 Operating System: FreeBSD 5.4
 PHP Version:      5.1.4
 New Comment:

Please report bugs in PCRELib to PCRE developers (pcre.org).
Thanks.


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

[2006-05-26 11:48:27] iain at iaindooley dot com

Description:
------------
I can't tell if this is universal, but with this particular regex it
certainly is a bug. I think it is to do with using parentheses directly
next to each other.

Reproduce code:
---------------
<?
    $str = 'arr[sub][sub_sub]';
    die(preg_replace('/([^\[\]]*)(.*)/','[\1]\2',$str));
?>

just for the record, this works as expected if i use the pattern:

preg_replace('/([^\[\]]*)\[(.*)\]/','[\1][\2]',$el);

so it appears that the problem is when parenthesised (is that correct?)
expression appear next to each other.

Expected result:
----------------
[arr][sub][sub_sub]

Actual result:
--------------
[arr][sub][sub_sub][]


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


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

Reply via email to