I have
<table id="needle"><tr><td>X</td></tr><table>...</table><table>...</table></table>
I found X
position, then I found <
position of #needle
table, and how to find position of last >
pair #needle
tag
I have
<table id="needle"><tr><td>X</td></tr><table>...</table><table>...</table></table>
I found X
position, then I found <
position of #needle
table, and how to find position of last >
pair #needle
tag
you could use html5lib. Less recommended but works too: YQL by yahoo
EDIT: removed regex because of comments. The probably best overview had gordon listed in his comment: How do you parse and process HTML/XML in PHP?