php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63155 Regular expression problem with character 'ё'
Submitted: 2012-09-24 19:27 UTC Modified: 2012-10-01 08:44 UTC
From: zet-00 at mail dot ru Assigned: ab (profile)
Status: Wont fix Package: *General Issues
PHP Version: 5.4.7 OS: Windows XP
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zet-00 at mail dot ru
New email:
PHP Version: OS:

 

 [2012-09-24 19:27 UTC] zet-00 at mail dot ru
Description:
------------
http://unicode-table.com/ru/#cyrillic

Can you make what 'а-я'  (0430 - 0439)  expression include literal 'ё' (0451)
becouse russian alphabet contains this char in middle of list

Kinda got problems when make surname check or etc.

Test script:
---------------
	$surname = 'ёмобиль';
	
	$res = preg_match('/^([а-я]+)$/iu', $surname);

	if(!$res) {
		echo 'Фамилия содержит не корректные символы';
		echo 'Surname contains non-valid characters';
	}

//  preg_match not see char 'ё' 


//  preg_match('/^([ё-я]+)$/iu', $surname);
//  make Warning  even caseless mode set

//  preg_match('/^([Ё-я]+)$/iu', $surname);  //  work as should


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-24 19:34 UTC] zet-00 at mail dot ru
-Summary: Regular extension problem with character 'ё' +Summary: Regular expression problem with character 'ё'
 [2012-09-24 19:34 UTC] zet-00 at mail dot ru
*
 [2012-10-01 08:44 UTC] ab@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: ab
 [2012-10-01 08:44 UTC] ab@php.net
This is most likely not a PHP and not a windows issue. The char 'ё' is known to cause issues for very long time, I remember the old good Netscape having similar parse issues :) ... But anyway, linux behaviour is the same and it's all libpcre. A workaround I'd suggest is to change your pattern to '/^([а-яё]+)$/iu' - works for me.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC