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

Reply via email to