php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48433 Case related bug in mb_ereg_* lookbehind
Submitted: 2009-05-30 09:24 UTC Modified: 2009-09-26 01:00 UTC
From: l_done at tiscali dot it Assigned:
Status: No Feedback Package: mbstring related
PHP Version: 5.2.9 OS: Linux/OSX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: l_done at tiscali dot it
New email:
PHP Version: OS:

 

 [2009-05-30 09:24 UTC] 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
)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-30 09:47 UTC] l_done at tiscali dot it
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)
 [2009-09-18 19:06 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-09-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 16:01:33 2025 UTC