Using PHP 5.3.1, PCRE is enabled and is version 7.9 2009-04-11.
$string = preg_replace("/\p{Number}/u", "", $string);
produces the error: Compilation failed: unknown property name after \P . . .
I understand this was a bug that is fixed in PHP 5.3 and up but I obviously get it as do others using my scripts. As far as I can make out, it might be something to do with the version of PCRE that is being used or how it was compiled.
I have no control over the compiled version of PHP that is being used.
Is there a way to check in the PHP script if PCRE has been compiled correctly?
I'm also using:
preg_match("/\p{Lu}/u", $caseChar); preg_match("/\p{Ll}/u", $caseChar); preg_match("/\p{L}/u", $string, $caseChar);
If incorrect PCRE has been found (if 1. is possible), is there an alternative to the above preg_replace and preg_match expressions?
Thanks,
Mark
http://php.net/manual/en/regexp.reference.unicode.php
\p{Number} is not a supported property code as per the above. It's \p{N} or even just \pN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With