HTML regex problem
Posted: Sat Jun 16, 2007 7:35 pm
I am trying to parse the value "GDP (current US$)" for years 2000 and 2005 in the examples here and here
the script I'm formulating a regex for is:
and this is the pattern i made:
i get the array
any ideas of where i went wrong?
the script I'm formulating a regex for is:
Code: Select all
GDP (current US$) </a></font></td>
<td bgcolor="#ffffff" width="88" align="right"><font size="-2" face="Verdana,Tahoma,Arial,Helvetica">.. </font></td>
<td bgcolor="#ffffff" width="88" align="right"><font size="-2" face="Verdana,Tahoma,Arial,Helvetica">7.3 billion </font></td>Code: Select all
$pattern='&\(current US$\)\s*</a></font></td>\s*<td bgcolor="#ffffff" width="88" align="right">';
$pattern.='<font size="-2" face="Verdana,Tahoma,Arial,Helvetica">([^<]*)</font></td>\s*';
$pattern.='<td bgcolor="#ffffff" width="88" align="right"><font size="-2" face="Verdana,Tahoma,Arial,Helvetica">([^<]*)</font></td>&';i get the array
Code: Select all
Array
(
[0] => Array
(
)
[1] => Array
(
)
[2] => Array
(
)
)any ideas of where i went wrong?