I have a page where the data is in the below pattern
<html> <body>
<table>
<tr>
<td class='heading'>
some text
</td>
</tr>
<tr>
<td class='subheading'>sub1</t
d><td class="subheading'>sub2</t
d>
</tr>
<tr>
<td class='subheading'>sub3</t
d><td class="subheading'>sub4</t
d>
</tr>
</table>
<table>
<tr>
<td class='heading'>
some other heading
</td>
</tr>
<tr>
<td class='subheading'>sub1</t
d><td class="subheading'>sub2</t
d>
</tr>
<tr>
<td class='subheading'>sub3</t
d><td class="subheading'>sub4</t
d>
</tr>
</table>
I want to be able to extract all the headings and subheadings and associate the proper heading with their subheading..
what would be the easiest way to do this in regex or is there any other way to do this ?