PHP 4.0 Bug #6680: regexps (ereg*) ignores locale settings
| From: | mbravo at tag-ltd dot spb dot ru | Date: | Tue, 12 Sep 2000 09:54:33 +0000 |
| Subject: | PHP 4.0 Bug #6680: regexps (ereg*) ignores locale settings | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32968@lists.php.net to get a copy of this message | ||
From: mbravo@tag-ltd.spb.ru
Operating system: FreeBSD 4.1-RELEASE
PHP version: 4.0.1pl2
PHP Bug Type: *Regular Expressions
Bug description: regexps (ereg*) ignores locale settings
<?php
if(eregi("^[[:alnum:]]+$",$t1)) {
printf("alnum<br>");
} else {
printf("not alnum<br>");
}
?>
when invoked with $t1=<some string in cyrillic koi8-r encoding> (example -
"×ÁÓÑ") and correct locale settings (see below) prints "not alnum"
while at the command line grep -E with the same input matches:
-------
mbravo@tag-ltd:pages$ grep -E '[[:alnum:]]+'
×ÁÓÑ
×ÁÓÑ
-------
PHP configured as -
'./configure' '--prefix=/opt/www' '--with-apxs=/opt/www/bin/apxs'
'--with-mod_charset' '--with-mysql=/opt' '--with-pgsql=/opt'
posix
Revision $Revision: 1.17 $
LANG ru_RU.KOI8-R
HTTP_ENV_VARS["LANG"] ru_RU.KOI8-R