I have a string like this (made from HTML source code):
<tr>
<td>
<tr>First</tr>
</td>
</tr>
<tr>
<td>Second</td>
</tr>
<tr>
<td>
<tr>
<td>Upper</td>
</tr>
<tr>
<td>Lower</td>
</tr>
</td>
</tr>
but in one line - I divided it to make it look better. What I want to achieve is a regular expression that will capture whole rows of this table, so the matches are:
<td>
<tr>First</tr>
</td>
,
<td>Second</td>
,
<td>
<tr>
<td>Upper</td>
</tr>
<tr>
<td>Lower</td>
</tr>
</td>
The most simple options:
<tr>.*</tr>
- catches everything<tr>.*?</tr>
- catches from the first<tr>
to the first</tr>
.
I want it to catch corresponding tags. Can anybody help?