I'm new at working with regular expression, so please be patient with me. I'm trying to grab the content that is located between two tables.
Here's the code:
<table bgColor=#ffffff border=0 cellspacing=1 width="100%" cellpadding=0>
<tr bgcolor="#FFE680" vAlign=middle>
<td align="middle" valign="top" width="12%"><b>
<font size=2 face="Arial, Helvetica, sans-serif">Item Title</font></b><br></td></tr></font></table>
//Stuff I want to grab
A whole lot tables are located here.
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td align="right" height="25"><font face="Arial, Helvetica, sans-serif" size="2"><a href="#">
top of page</a></font></td>
$page is an fread of a text file that contains all the tables. The first and last table are not the first and last table on the text file. There are many tables before and after them.
preg_match("/>Item Title.?</table>(.*?)<table width=\"100%\" border/", $page, $chunk);
Regarding the first table, there is another table before it that's almost identical. The only difference is that the Item Title is in a field by itself. The other table has more text in that field, located before Item Title.
On the last table, what makes it unquie from the tables between it and the first table is that after the table width, the next attribute is the border. In the other tables it's cellpadding.
When I run this code in a script, I get the following error:
Warning: Unknown modifier 't' in /path/to/test.php on line 6