I need some help with making a valid regex.
Here is what I have so far . . .
<?
///// Extract standings table from NHL.com
$html=file_get_contents('http://www.nhl.com/onthefly/standings/20032004/print_league_standings.html');
$match ='|<table width="100%" cellpadding="2" cellspacing="0" border="0">';
$match.='(.*)';
$match.='</table>|';
preg_match_all ($match, $html, $out);
$html=$out[0][0];
///// Extract data from standings table
$match ='|<tr bgcolor="#[0-9]">';
$match.='<td class="HEADLINEGRAPH">[0-9]</td>';
$match.='<td class="HEADLINEGRAPH"><a href="[.*]">[a-zA-Z]</a></td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right" bgcolor="#[0-9]">[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]-[0-9]-[0-9]-[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]-[0-9]-[0-9]-[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]-[0-9]-[0-9]-[0-9]</td>';
$match.='<td class="HEADLINEGRAPH" align="right">[0-9]-[0-9]-[0-9]-[0-9]</td>';
$match.='</tr>|';
preg_match_all ($match, $html, $out2);
echo $out2[0][0]."<BR>";
?>
Basically I want to extract the data from within each table cell.
Help . . . ! ! !
I hate regex with a passion . . .
🙂 🙂