While the result of pcretest -C
in my server says that pcre supports utf8, but the following code always returns false even if I enter a matching pattern, and seems that it doesn't recognize utf-8 characters:
$pattern = '/^\x{06F0}?\x{06F9}\d{9}$/u';
if (!preg_match($pattern, $value)) { // $value is a function parameter
return false;
}
return true;
Output of pcretest -C
:
PCRE version 7.8 2008-09-05
Compiled with
UTF-8 support
Unicode properties support
Newline sequence is LF
\R matches all Unicode newlines
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
PHP version: 5.3.2
This code works as expected in my localhost.
Any suggestion?