preg_match имеет ограничение на размер строки

preg_match имеет ограничение str на PHP 5.2.5

<?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";
6
задан hakre 20 December 2012 в 19:33
поделиться