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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 20:01:34 2025 UTC