Find the end of a tag pair
<p>I have </p>

<pre><code>&lt;table id="needle"&gt;&lt;tr&gt;&lt;td&gt;X&lt;/td&gt;&lt;/tr&gt;&lt;table&gt;...&lt;/table&gt;&lt;table&gt;...&lt;/table&gt;&lt;/table&gt;
</code></pre>

<p>I found <code>X</code> position, then I found <code>&lt;</code> position of <code>#needle</code> table, and how to find position of last <code>&gt;</code> pair <code>#needle</code> tag</p>
