#40626 [NEW]: preg_match and koi8-r

From: Date: Sun, 25 Feb 2007 07:24:22 +0000
Subject: #40626 [NEW]: preg_match and koi8-r
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-109485@lists.php.net to get a copy of this message
From: themixa at gmail dot com Operating system: Linux(PHP-5.1.6), Freebsd(PHP-4) PHP version: 4.4.5 PHP Bug Type: PCRE related Bug description: preg_match and koi8-r Description: ------------ preg_match don't recognize some letters in KOI8-R. Reproduce code: --------------- <? $result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R"); if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) { die("skip setlocale() failed\n"); } #FRS is First russian letter #LRS is Last russian letter echo preg_match("/^[&#1072;-&#1103;&#1040;-&#1071;]+$/","&#1081;&#1094;&#1091;&#1082;&#1077;&#1085;&#1075;&#1096;&#1097;&#1079;&#1093;&#1098;&#1092;&#1099;&#1074;&#1072;&#1087;&#1088;&#1086;&#1083;&#1076;&#1078;&#1101;&#1103;&#1095;&#1089;&#1084;&#1080;&#1090;&#1100;&#1073;&#1102;"); #patterrn with [frs-lrsFRS-LRS] and string contained full russian alphabet return 0 echo preg_match("/^[&#1072;-&#1103;&#1040;-&#1071;]+$/","&#1072;&#1073;&#1043;&#1044;&#1077;&#1082;"); #patterrn with [frs-lrsFRS-LRS] and string some few russian letters (forexample, without third letter in alphabet) return 1 ?> Expected result: ---------------- First and second preg_match must return 1 Actual result: -------------- Only second preg_match must return 1 -- Edit bug report at http://bugs.php.net/?id=40626&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40626&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40626&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40626&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40626&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40626&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40626&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40626&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40626&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40626&r=support Expected behavior: http://bugs.php.net/fix.php?id=40626&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40626&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40626&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40626&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40626&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40626&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40626&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40626&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40626&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40626&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40626&r=mysqlcfg

« previous php.bugs (#109485) next »