php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45035 Reg exp. '/\w/u' not include ő, ű, Ő; and Ű; utf characters
Submitted: 2008-05-18 18:52 UTC Modified: 2008-05-19 09:29 UTC
From: kamarton at gmail dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.2.6 OS: Win XP
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: kamarton at gmail dot com
New email:
PHP Version: OS:

 

 [2008-05-18 18:52 UTC] kamarton at gmail dot com
Description:
------------
The regular expression engine with 'u' modifiers '\w' class not include few hungarian characters.
Not include: ő, ű, Ő and Ű.
PHP source file coding in utf8 with BOM.

Sorry my english.
Regards,
Marton

System:
WinXP, SP2
PHP 5.2.5 (xampp version)
(source editor: Notepad++ v4.9.2.)

Reproduce code:
---------------
echo preg_replace('/\w/u','_','???ő???ű????Ő???Ű?');

Expected result:
----------------
echo -> '__________________'

Actual result:
--------------
echo -> '___ő___ű____Ő___Ű_'

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-18 19:07 UTC] kamarton at gmail dot com
Reproduce code:
---------------
echo preg_replace('/\w/u','_','???ő???ű????Ő???Ű?');

Expected result:
----------------
echo -> '__________________'

Actual result:
--------------
echo -> '___ő___ű____Ő___Ű_'
 [2008-05-19 09:29 UTC] nlopess@php.net
Not a bug in PHP. Bugs in the PCRE lib should be filled at: http://bugs.exim.org/enter_bug.cgi?product=PCRE
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 01:01:35 2025 UTC