|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39999 mb_eregi_replace() and mb_ereg_replace() is not caseinsensitive for multibyte
Submitted: 2007-01-02 08:45 UTC Modified: 2007-01-11 16:05 UTC
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: zilvinas at speros dot lt Assigned:
Status: Not a bug Package: mbstring related
PHP Version: 5.2.0 OS: Debian 2.6.12-1-k7-smp
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: zilvinas at speros dot lt
New email:
PHP Version: OS:


 [2007-01-02 08:45 UTC] zilvinas at speros dot lt
The function mb_eregi_replace() and/or function mb_ereg_replace() with 'i' option is not caseinsensitive for multibyte characters.

Reproduce code:

$pattern = utf8_encode('?');
$replace = 'X';
$subject = utf8_encode('?BER ?ber');

$result = mb_eregi_replace($pattern, $replace, $subject);
//$result = mb_ereg_replace($pattern, $replace, $subject, 'i');

echo utf8_decode($result) . "\n";

Expected result:

Actual result:
?BER Xber


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-02 09:37 UTC] zilvinas at speros dot lt
A more simplistic example to reproduce the problem:

Reproduce code:



$pattern = '?'; //s 'crown'
$replace = 'X';

$subject = '?iltas, ?iltas';

$result = mb_eregi_replace($pattern, $replace, $subject);

echo $result;

Expected result: 
Xiltas, Xiltas

Actual result:
?iltas, Xiltas
 [2007-01-02 09:41 UTC] zilvinas at speros dot lt
changed category
 [2007-01-11 16:05 UTC]
ext/mbstring is a wrapper for Oniguruma library, which does the search and replace.
Therefore it's not PHP problem.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 12 13:01:33 2024 UTC