|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34119 mb_ereg chokes on \x80-\xF7
Submitted: 2005-08-13 13:12 UTC Modified: 2006-02-17 00:22 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: ondrej at sury dot org Assigned: hirokawa (profile)
Status: Closed Package: mbstring related
PHP Version: 4.4.0 OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ondrej at sury dot org
New email:
PHP Version: OS:


 [2005-08-13 13:12 UTC] ondrej at sury dot org
mb_ereg prints invalid regular expression error on certain characters.

This is fixed in php 5.0.4.

More information could be found at:

Reproduce code:
$name = "user/1/viewuser/1/edit";
if (mb_ereg("[^\x80-\xF7 [:alnum:]@_.-]", $name)) print('The username contains an illegal character.');

Expected result:
The username contains an illegal character.

Actual result:
Warning: mb_ereg(): mbregex compile err: invalid regular expression in /var/www/mb_ereg.php on line 4


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-13 20:29 UTC]
Moriyoshi, I guess you need to backport something..?
 [2005-12-24 02:32 UTC]
Rui, check this out please.
 [2005-12-24 06:20 UTC]
Please try using this CVS snapshot:
For Windows:

It works fine for me.
Please check it by CVS snapshot of PHP 4.4.

$name = "user/1/viewuser/1/edit";
if (ereg("[^\x80-\xF7 [:alnum:]@_.-]", $name)) {
  print "The username contains an illegal character.\n";
 } else {
  print "ok.\n";

Result in PHP 4.4.2RC2-dev (Linux FedoraCore4):
 The username contains an illegal character.

 [2006-01-01 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".
 [2006-02-17 00:22 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 00:05:53 2022 UTC