|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-10-22 10:16 UTC] kirill at digicol dot de
Description:
------------
The function mb_eregi_replace() is not caseinsensitive for multibyte characters.
This bug is in PHP 4.3.3 as well.
Reproduce code:
---------------
<?php
mb_regex_encoding('UTF-8');
$pattern = utf8_encode('?');
$replace = 'X';
$subject = utf8_encode('?BER ?ber');
$result = mb_eregi_replace($pattern, $replace, $subject);
echo utf8_decode($result) . "\n";
?>
Expected result:
----------------
XBER Xber
Actual result:
--------------
?BER Xber
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 15:00:01 2025 UTC |
You can replace mb_eregi_replace with preg_replace with u modifier. Example (utf-8 file encoding): <?php echo preg_replace('/(юникод)/iu', '<b>\\1</b>', 'Юникод удобен'); ?> As expected result is: <b>Юникод</b> удобен