preg_match具有字符串大小限制

| preg_match在PHP 5.2.5上具有str限制
<?php
    $str1 = \'a@b%c@d\' . str_repeat (\'=\', 33326);
    $str2 = \'a@b%c@d\' . str_repeat (\'=\', 33327);
    $regexp = \'/^(.*)@(.*)%(.*)$/si\';

    echo preg_match ($regexp, $str1) ? \"Correct \" : \"Wrong \";  // works correctly
    echo \"\\n\";
    echo preg_match ($regexp, $str2) ? \"Correct \" : \"Wrong \";  // exhibits the bug
    echo \"\\n\";
    
已邀请:
        在第二次调用后preg_last_error()返回2(= PREG_BACKTRACK_LIMIT_ERROR),因此您可能想提高此值。     

要回复问题请先登录注册