|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54506 Regex Unicode problem
Submitted: 2011-04-11 16:39 UTC Modified: 2011-04-11 20:47 UTC
From: chsavio at gmail dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.3SVN-2011-04-08 (snap) OS: Centos 2.6.18
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: chsavio at gmail dot com
New email:
PHP Version: OS:


 [2011-04-11 16:39 UTC] chsavio at gmail dot com
Combinations of unicode characters in brackets appear to match a completely incorrect character. We're using PHP 5.3.3 (cli). And I was able to reproduce the problem on a PHP regex test site.

Test script:

$ptn = "/[ÜŸ]/";
$str = "ø";
preg_match($ptn, $str, $matches);

Should be the equivalent of the following, but is not

$ptn = "/Ü|Ÿ/";
$str = "ø";
preg_match($ptn, $str, $matches);

Expected result:
I'd expect no matches.


Actual result:
I get a match.

    [0] => ø


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-11 16:52 UTC]
-Status: Open +Status: Bogus
 [2011-04-11 16:52 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

Use the /u modifier.
 [2011-04-11 20:47 UTC] chsavio at gmail dot com
Missed the PCRE modifiers section of the documentation. Sorry about that. Thanks for your time.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon May 23 21:03:42 2022 UTC