[英]PHP preg match all limit 3725 characters
how to increase search character limit? 如何增加搜索字符数限制? now in example is 3276 characters but in 3275 its works ok
现在示例中是3276个字符,但在3275中可以正常工作
ini_set("pcre.backtrack_limit", "23001337");
ini_set("pcre.recursion_limit", "23001337");
$str = "<div>";
for ($x=1;$x<=327;$x++){
$str .= "1234567890";
}
$str .="123456";
$str .= "</div>";
$w1 = "/<div>((.*?|\n)*)<\/div>/";
preg_match_all($w1, $str, $matches);
print_r($matches);
Try disabling pcre.jit (don't use PCRE's just-in-time compilation): 尝试禁用pcre.jit(不要使用PCRE的即时编译):
<?php
ini_set("pcre.jit", "0");
$str = "<div>";
for ($x=1;$x<=327;$x++){
$str .= "1234567890";
}
$str .="123456";
$str .= "</div>";
$w1 = "/<div>((.*?|\n)*)<\/div>/";
preg_match_all($w1, $str, $matches);
print_r($matches);
?>
You should execute preg_last_error() to know what has failed. 您应该执行preg_last_error()才能知道失败的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.