|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54240 mb_ereg_search_getpos() counts umlauts twice
Submitted: 2011-03-13 08:33 UTC Modified: 2012-06-20 23:16 UTC
From: phpbug at ymail dot com Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 5.2.17 OS:
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: phpbug at ymail dot com
New email:
PHP Version: OS:


 [2011-03-13 08:33 UTC] phpbug at ymail dot com
mb_ereg_search_getpos() seems to count German umlauts twice. See test script.

Test script:

$test1 = "ab";
$test2 = "ääb";
$test3 = "äääb";

mb_ereg_search_init($test1, "b");
echo "Test1: " . mb_ereg_search_getpos(); // Result: 2

mb_ereg_search_init($test2, "b");
echo "Test2: " . mb_ereg_search_getpos(); // Result: 5 (should be "3")

mb_ereg_search_init($test3, "b");
echo "Test3: " . mb_ereg_search_getpos(); // Result: 7 (should be "4")


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-20 23:16 UTC]
-Status: Open +Status: Not a bug
 [2012-06-20 23:16 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

As mentioned in the documentation:
"The position is represented by bytes from the head of string."
and as such this is the expected behavior.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 04 14:01:28 2023 UTC