I am having an issue with a regular expression and cannot figure out what is wrong. I have taken each line of html and the corresponding regular expression and placed it in
RegexCoach and RegexBuilder, checking each line by line and they all match. But I cannot get the array $matches to show any data when I test it
preg_match("/AMERICAN LEAGUE STANDINGS.*?AL Central/is", $contents, $results);
preg_match_all("/<td[^>]*?><a href=\"\/baseball\/mlb\/team\/\w+\/team.aspx\">(.+?)<\/a><\/td>
<td[^>]*?>(\d+)<\/td>
<td[^>]*?>(\d+)<\/td>
<td[^>]*?>(\.\d+)<\/td>
<td[^>]*?>(.+?)<\/td>
<td[^>]*?>(\d+-\d+)<\/td>
<td[^>]*?>(\d+-\d+)<\/td>
<td[^>]*?>(\d+-\d+)<\/td>
<td[^>]*?>(\d+-\d+)<\/td>
<td[^>]*?>(\d+-\d+)<\/td>
<td[^>]*?>(.+?\s\d+)<\/td>
<td[^>]*?>(\d+-\d+)<\/td>/is", $results[0], $matches, PREG_SET_ORDER);
print_r ($matches);
exit;
here is the html:
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdTeamName"><a href="/baseball/mlb/team/bos/team.aspx">Boston</a></td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdW" align="right">5</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdL" align="right">1</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdPct" align="right">.833</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdGB" align="right">--</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdHome" align="right">0-0</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdRoad" align="right">5-1</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdEast" align="right">3-0</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdCent" align="right">0-0</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdWest" align="right">2-1</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdStreak" align="right">Won 4</td>
<td id="ContentRepeater__ctl0__ctl2_DlStandings__ctl0_tdLTen" align="right">5-1</td>
I checked, double checked, and triple checked each line in these programs, and the data that is in $results and it shows data....
Can someone please help me!!!!
TIA
Mike