#46920 [Bgs]: preg_* fails with long matches

From: Date: Mon, 22 Dec 2008 12:23:39 +0000
Subject: #46920 [Bgs]: preg_* fails with long matches
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132254@lists.php.net to get a copy of this message
ID: 46920 Updated by: scottmac@php.net Reported By: gdiego at gmail dot com Status: Bogus Bug Type: PCRE related Operating System: linux PHP Version: 5.2.8 New Comment: Check preg_last_error(), you've reached one of the limits set which both are 10,000 by default. http://www.php.net/manual/en/pcre.configuration.php Previous Comments: ------------------------------------------------------------------------ [2008-12-22 12:23:21] scottmac@php.net Check preg_last_error(), you've reached one of the limits set which both are 10,000 by default. http://www.php.net/manual/en/pcre.configuration.php ------------------------------------------------------------------------ [2008-12-22 12:23:03] scottmac@php.net Check preg_last_error(), you've reached one of the limits set which both are 10,000 by default. http://www.php.net/manual/en/pcre.configuration.php ------------------------------------------------------------------------ [2008-12-21 22:26:04] gdiego at gmail dot com Description: ------------ If the match for a regex is very long, it fails. Reproduce code: --------------- $a='A'; for ($i = 0; $i < 1024; $i++) $a.='a'; $a.='A'; var_dump(preg_match('/A(.*?)A/', $a, $m)); $a='A'; for ($i = 0; $i < 131072; $i++) $a.='a'; $a.='A'; var_dump(preg_match('/A(.*?)A/', $a, $m)); Expected result: ---------------- int(1) int(1) Actual result: -------------- int(1) int(0) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46920&edit=1

« previous php.bugs (#132254) next »