php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48790 Unicode character properties misbehave
Submitted: 2009-07-03 16:59 UTC Modified: 2009-07-03 20:27 UTC
From: php at pwnt dot be Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.2.10 OS: All
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at pwnt dot be
New email:
PHP Version: OS:

 

 [2009-07-03 16:59 UTC] php at pwnt dot be
Description:
------------
The behavior described at http://php.net/manual/en/regexp.reference.unicode.php seems to have changed between PHP 5.2.8 and 5.2.10 (don't know about 5.2.9). I use preg_match() with a \p regexp to check if a character is a letter (or a number, in this case), and this seems to fail for wide characters in 5.2.10.

Reproduce code:
---------------
echo preg_match('/^[\pL\pN]$/', '?');

Expected result:
----------------
1

Actual result:
--------------
PHP 5.2.8: 1
PHP 5.2.10: 0

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-03 17:09 UTC] php at pwnt dot be
This also occurs on Linux.
 [2009-07-03 20:27 UTC] nlopess@php.net
The reproduce code is broken (I cannot read the input character), but anyway if this is a bug, it's surelly not in PHP.
If you strongly believe this is a bug, please report it to the PCRE team.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 11:01:31 2025 UTC