I\'ve a PHP library that uses a number of regular expressions featuring the \\P
expressions for multibyte strings, e.g.
((((?:\\P{M}\\p{M}*)+?)|
While comments suggest checking for PREG_BAD_UTF8_ERROR
the PHP source http://lxr.php.net/xref/PHP_5_6/ext/pcre/php_pcre.c#141 suggests this constant is always available if PCRE is. Indeed it seems --enable-unicode-properties
is a PCRE lib switch and is simply not exposed by PHP. The only thing I can imagine is running a simple regexp once with warning supressed...
Other than trying it, I think the only way is to use the pcretest
command line tool, with the -C
option (compile-time options):
bash-4.1.5$ pcretest -C
No UTF-8 support
No 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