#19346 [Opn]: preg_match() does not work for UTF-8

From: Date: Tue, 10 Sep 2002 22:31:34 +0000
Subject: #19346 [Opn]: preg_match() does not work for UTF-8
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18987@lists.php.net to get a copy of this message
ID: 19346 User updated by: gamid@isayev.net Reported By: gamid@isayev.net Status: Open Bug Type: PCRE related Operating System: Mandrake 8.1 -PHP Version: 4.2.2 +PHP Version: 4.3.2-dev New Comment: BTW, it also does not work in PHP 4.3.2-dev, PHP: 20020307 PHP Extension: 20020429 Zend Extension: 20020903 Previous Comments: ------------------------------------------------------------------------ [2002-09-10 17:30:08] gamid@isayev.net <? $name = "Test".utf8_encode("\xDC");; echo "name = '$name'<BR>\n"; echo preg_match("/^[[:alpha:]]+$/u", $name); echo "<BR>\n"; ?> The above snippet does not produce expected result. According to documentation, preg_match() should return a true value, but it returns false. It looks as modifier 'u' does not work as it is described in the manual ( http://www.php.net/manual/en/pcre.pattern.modifiers.php ). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19346&edit=1

« previous php.bugs (#18987) next »