#46779 [Opn->Bgs]: Compilation failed in preg_replace for Unicode character properties

From: Date: Mon, 08 Dec 2008 22:04:33 +0000
Subject: #46779 [Opn->Bgs]: Compilation failed in preg_replace for Unicode character properties
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-131773@lists.php.net to get a copy of this message
ID: 46779 Updated by: nlopess@php.net Reported By: dytrych at webovy-servis dot cz -Status: Open +Status: Bogus Bug Type: PCRE related Operating System: Debian GNU/Linux 2.6.23.17 PHP Version: 5.2.7 New Comment: I can't reproduce this problem. My guess is that you are linking against your system's PCRE library (which can be confirmed by checking if pcre appears in output of "ldd which php") instead of using the bundled version. If that is the case, then your library was compiled without unicode support. Previous Comments: ------------------------------------------------------------------------ [2008-12-06 11:24:51] dytrych at webovy-servis dot cz Description: ------------ Unicode character properties doesn't work in preg_replace (since PHP 5.2.7). PCRE (Perl Compatible Regular Expressions) Support enabled PCRE Library Version: 7.8 2008-09-05 Results with phpinfo: http://seo-servis.cz/testpl.php Reproduce code: --------------- echo preg_replace("~[^\\pL]+~u", '-', "a 3"); echo preg_replace('~[^\\p{L}]+~u', '-', "a 3"); Expected result: ---------------- a-3 a-3 Actual result: -------------- Warning: preg_replace() [function.preg-replace]: Compilation failed: unknown property name after \P or \p at offset 4 in xxx on line 3 Warning: preg_replace() [function.preg-replace]: Compilation failed: unknown property name after \P or \p at offset 6 in xxx on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46779&edit=1

« previous php.bugs (#131773) next »