preg_match bug in PHP 5.2.1 ?
Posted: Fri May 11, 2007 10:41 pm
Hi
I was updating a RegExp pattern recently and I was breaking my head trying to figure out why $matches of preg_match was returning an empty array always.
I tried this on a server having php version 4 and it worked !
Returns an empty array in PHP 5.2.1 but otherwise returns the pattern-matched array (Tested and works in versions 4.4.4, 4.3.11).
Im going to update to 5.2.2, but does ver 5.2.2 have PCRE Library Version greater than 6.7 04-Jul-2006 ? Isnt this dependant on the PCRE version alone ?
I was updating a RegExp pattern recently and I was breaking my head trying to figure out why $matches of preg_match was returning an empty array always.
I tried this on a server having php version 4 and it worked !
Code: Select all
<pre>
<?php
// preg_match bug in php-5.2.1.php ?
$URL = "http://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback2&userid=quality_coins_and_currency&ftab=FeedbackAsSeller&items=200&page=1";
$contents = file_get_contents($URL);
if ($contents === FALSE) die("Couldnt retrieve http contents");
preg_match('#<table border="0" cellpadding="0" cellspacing="0" width="100%" class="fbOuter">(.*?)</table>#is', $contents, $matches);
print_r($matches);
?>Im going to update to 5.2.2, but does ver 5.2.2 have PCRE Library Version greater than 6.7 04-Jul-2006 ? Isnt this dependant on the PCRE version alone ?