S
Shailesh Humbad
I want to parse the values from the second-to-last row in an html
table.
....
<tr class="odd">
<td style="text-align: right;" nowrap="nowrap">99</td>
<td style="text-align: right;" nowrap="nowrap">111</td>
<td style="text-align: right;" nowrap="nowrap">52255</td>
<td style="text-align: right;" nowrap="nowrap">333</td>
<td style="text-align: right;" nowrap="nowrap">2323</td>
</tr>
<tr class="totals">
....
I can identify the last row by the "totals" class. So I want the regex
to work backward from there and get the values in each of the cells of
the previous row. It should ignore all prior content and whitespace
between tags. Can anyone help? Here is what I have so far:
/([\s\S]*?)<tr class\=\"totals/
table.
....
<tr class="odd">
<td style="text-align: right;" nowrap="nowrap">99</td>
<td style="text-align: right;" nowrap="nowrap">111</td>
<td style="text-align: right;" nowrap="nowrap">52255</td>
<td style="text-align: right;" nowrap="nowrap">333</td>
<td style="text-align: right;" nowrap="nowrap">2323</td>
</tr>
<tr class="totals">
....
I can identify the last row by the "totals" class. So I want the regex
to work backward from there and get the values in each of the cells of
the previous row. It should ignore all prior content and whitespace
between tags. Can anyone help? Here is what I have so far:
/([\s\S]*?)<tr class\=\"totals/