使用PHP 5.3.1, PCRE是启用的,是版本7.9 2009-04-11
$string = preg_replace("/'p{Number}/u", "", $string);
产生错误:编译失败:'P后的属性名未知…
我知道这是一个错误,在PHP 5.3和更高版本中修复,但我显然得到它,因为其他人使用我的脚本。据我所知,这可能与正在使用的PCRE版本或它的编译方式有关。
我无法控制正在使用的PHP编译版本。
是否有一种方法来检查PHP脚本,如果PCRE已被正确编译?
我也使用:
preg_match ("/' p{陆}/u",caseChar美元);preg_match("/' p{你}/u",caseChar美元);preg_match("/' p {L}/u",字符串,美元caseChar美元);
如果发现不正确的PCRE(如果1。是可能的),是否有替代上述preg_replace和preg_match表达式?
谢谢,马克
http://php.net/manual/en/regexp.reference.unicode.php
如上所述, 'p{Number}
不是支持的属性代码。是'p{N}
,甚至是'pN