reg expr help
Hello, I have a question about a regular expression
I am stripping some content out of a website,
I need to grab the text between 2 td tags, and the td tag has class="contentIwant"
The trouble is many of the pages also have another td with the same class,
as you can see below
-----
<td class="contentIwant" height="8"><img src="images/spacer.gif" width="1" height="8"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="justify" class="contentIwant"><p><i>Jonathan Livingston Seagull</i> was one of the hits of the 1970s. THIS IS THE TEXT I WANT</td>
Can some one help me please.
I have tried the following two RegExprs, but the both grab the <img src.... which I dont want
$found = preg_match('/class="gmatter3".*?>((.*\n) *?.*)<\/td>/', $the_page,$matches);
$found = preg_match('/class="gmatter3".*?>(?!.img src)((.*\n)*?.*)<\/td>/', $the_page,$matches);
Thanks in advance
Frazer
I am stripping some content out of a website,
I need to grab the text between 2 td tags, and the td tag has class="contentIwant"
The trouble is many of the pages also have another td with the same class,
as you can see below
-----
<td class="contentIwant" height="8"><img src="images/spacer.gif" width="1" height="8"></td>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="justify" class="contentIwant"><p><i>Jonathan Livingston Seagull</i> was one of the hits of the 1970s. THIS IS THE TEXT I WANT</td>
Can some one help me please.
I have tried the following two RegExprs, but the both grab the <img src.... which I dont want
$found = preg_match('/class="gmatter3".*?>((.*\n)
$found = preg_match('/class="gmatter3".*?>(?!.img src)((.*\n)*?.*)<\/td>/', $the_page,$matches);
Thanks in advance
Frazer
