私のサーバーでの結果はpcretest -C
、pcreがutf8をサポートしていると言っていますが、次のコードは、一致するパターンを入力しても常にfalseを返し、utf-8文字を認識しないようです:
$pattern = '/^\x{06F0}?\x{06F9}\d{9}$/u';
if (!preg_match($pattern, $value)) { // $value is a function parameter
return false;
}
return true;
の出力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 バージョン: 5.3.2
このコードは、ローカルホストで期待どおりに機能します。
なにか提案を?