Edit report at http://bugs.php.net/bug.php?id=52333&edit=1

 ID:               52333
 User updated by:  a dot dobkin at drweb dot com
 Reported by:      a dot dobkin at drweb dot com
 Summary:          Metacharacter \d in a regexp causes an error on some
                   Russian letters
 Status:           Open
 Type:             Bug
 Package:          *Regular Expressions
 Operating System: Windows
 PHP Version:      5.3.2

 New Comment:

OS 2003 Server R2 SP2 English x86


Previous Comments:
------------------------------------------------------------------------
[2010-07-14 07:03:15] a dot dobkin at drweb dot com

Description:
------------
Metacharacter \d in a regular expression causes an error on some Russian
letters 

on OS Windows. 



Example script:



$user_name_ru = "Василий";

$regexp = "/[\d...@\#\%\$\^&*\(\)\~\=\/\|\"\'\?\:\;\/]+/";

if( preg_match( $regexp,$user_name_ru ) ) {

 echo 'ERR';

} else {

 echo 'OK';

}



preg_match() return true if word contains one or more characters 'й',
'г', 'в'. 

If to delete metacharacter '\d' preg_match() returns false.   If you are
using 

php version 5.2.13 all works correctly.



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52333&edit=1

Reply via email to