ID: 49333
Updated by: [email protected]
Reported By: inf3rno dot hu at gmail dot com
Status: Open
Bug Type: PCRE related
Operating System: Windows XP
PHP Version: 5.2.10
New Comment:
Could not reproduce. When I run the code example you supplied, I get
the expected result. Are you sure you have submitted the right code
example?
Previous Comments:
------------------------------------------------------------------------
[2009-08-23 08:10:45] inf3rno dot hu at gmail dot com
Description:
------------
I developed a recursive regex pattern for compile template patterns.
During the tests I found this bug. I managed to restrict it to the
following piece of code.
The count of the numbers, and every character (\n too) counts. So if I
have 11+ characters long string in the 'y'-s block, then it's buggy, but
by 10- character long strings it works fine.
I hope it's a real bug, and not a damage in my computer. :-)
Reproduce code:
---------------
$pattern='%.*?(?:([a-z])(?:.*?(?:(?R).*?)*?\1)?|$)%sD';
$test='
x
0123456789
x
y
01234567890
y';
preg_match_all($pattern,$test,$matches,PREG_SET_ORDER);
var_dump($matches);
Expected result:
----------------
array(3) { [0]=> array(2) { [0]=> string(18) " x 0123456789 x" [1]=>
string(1) "x" } [1]=> array(2) { [0]=> string(19) " y 01234567890 y"
[1]=> string(1) "y" } [2]=> array(1) { [0]=> string(0) "" } }
Actual result:
--------------
array(0) { }
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49333&edit=1