ID: 48433
User updated by: l_done at tiscali dot it
Reported By: l_done at tiscali dot it
Status: Open
Bug Type: Regexps related
Operating System: Linux/OSX
PHP Version: 5.2.9
New Comment:
I tested this with those php versions:
PHP 5.2.9 with Suhosin-Patch 0.9.7 (cli) (built: Mar 25 2009 12:11:14)
(archlinux)
PHP 5.2.8 (cli) (built: Feb 5 2009 21:21:13) (osx)
PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23
2009 14:37:14) (ubuntu 9.04)
PHP 5.2.4-2ubuntu5.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 17
2009 14:31:37) (ubuntu 8.04)
Previous Comments:
------------------------------------------------------------------------
[2009-05-30 09:24:42] l_done at tiscali dot it
Description:
------------
When using alternation in negative lookbehind in a case-insensitive
regexp with mb_ereg* functions, if the alternatives are of different
lengths, the first alternative is treated in a "case-sensitive" way.
Reproduce code:
---------------
$text='
aA 1
bBb 2
cCcc 3
dDddd 4
';
$pattern='(?<!aa |bbb |cccc )[1-4]';
mb_ereg_search_init($text,$pattern,'i');
$r=mb_ereg_search_pos();
while ($r!==false) {
$match=mb_ereg_search_getregs();
print_r($match);
$r=mb_ereg_search_pos();
}
Expected result:
----------------
Array
(
[0] => 4
)
Actual result:
--------------
Array
(
[0] => 1
)
Array
(
[0] => 4
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48433&edit=1