Req #6680 [Opn->Bgs]: regexps (ereg*) ignores locale settings
| From: | johannes@php.net | Date: | Fri, 06 Aug 2010 23:44:46 +0000 |
| Subject: | Req #6680 [Opn->Bgs]: regexps (ereg*) ignores locale settings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-153188@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=6680&edit=1
ID: 6680
Updated by: johannes@php.net
Reported by: mbravo at tag-ltd dot spb dot ru
Summary: regexps (ereg*) ignores locale settings
-Status: Open
+Status: Bogus
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: FreeBSD 4.1-RELEASE
PHP Version: 4.0.1pl2
Block user comment: N
New Comment:
ereg is deprecated in favor of preg
Previous Comments:
------------------------------------------------------------------------
[2001-08-31 06:32:07] sander@php.net
Moved to feature request.
------------------------------------------------------------------------
[2000-09-17 16:30:36] stas@php.net
You may want to use PCRE extension - it supports locale settings.
------------------------------------------------------------------------
[2000-09-12 05:54:33] mbravo at tag-ltd dot spb dot ru
<?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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=6680&edit=1