Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
How to parse and process HTML with PHP?
i need help. I have HTML, and i need regular expression which give me table. only one table. because after this table goes another tables. example html:
<table class="results" cellspacing="1" cellpadding="0" border="0" width="100%" align="left">
<tr><td>text</td></tr>
</table>
<!-style>
tr.bg_selected{}
tr.bg_selected td, tr.bg_checked td { background-color:#ffe9bc !important;}
</style>**AND ANOTHER TABLE**
its my regular. there i get all tables after this table.
$regular = "/<table class=\"results\" cellspacing=\"(\d+)\" cellpadding=\"(\d+)\" border=\"(\d+)\" (.*)>(.*)<\/table>\n(.*)<\/style>/s";
preg_match_all($regular,$str, $matches2, PREG_PATTERN_ORDER);