#47656 [Opn->Bgs]: preg_match doesn't match certain string length
| From: | scottmac@php.net | Date: | Sat, 14 Mar 2009 13:53:22 +0000 |
| Subject: | #47656 [Opn->Bgs]: preg_match doesn't match certain string length | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-134694@lists.php.net to get a copy of this message | ||
ID: 47656
Updated by: scottmac@php.net
Reported By: bugs at no-signal dot com
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: Linux
PHP Version: 5.2.9
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
See preg_last_error(), you've hit the backtrack limit due to the way
you've written the expression.
Previous Comments:
------------------------------------------------------------------------
[2009-03-14 11:43:57] bugs at no-signal dot com
Description:
------------
preg_match will match against
'ourproducts/documentaries/test12345.html'
but not against 'ourproducts/documentaries/test123456.html'
preg_match_all does return the expected result, however.
Reproduce code:
---------------
$result =
preg_match('#^((?:[^/]+/?)+)/(.*)$#i','ourproducts/documentaries/test123456.html',$matches);
var_dump($matches);
Expected result:
----------------
array(3) {
[0]=>
string(40) "ourproducts/documentaries/test123456.html"
[1]=>
string(25) "ourproducts/documentaries"
[2]=>
string(14) "test123456.html"
}
Actual result:
--------------
array(0) {
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47656&edit=1