From: l_done at tiscali dot it Operating system: Linux/OSX PHP version: 5.2.9 PHP Bug Type: Regexps related Bug description: Case related bug in mb_ereg_* lookbehind
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 bug report at http://bugs.php.net/?id=48433&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48433&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48433&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48433&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48433&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48433&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48433&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48433&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48433&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48433&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48433&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48433&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48433&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48433&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48433&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48433&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48433&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48433&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48433&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48433&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48433&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48433&r=mysqlcfg
