I want to use Regular Expression (compatible with pcre) to select a table
cell in an XML or HTML file.
This cell was expanded in several lines containing
other elements and relative attributes and values. This
cell supposed to be at the last column.
for some reasons I can't and don't want to use ". matches newline
" option.
for example in this code:
EDITED:
<table colcount="4">
<tr>
<td colspan="2">
<para><text> Mike</text></para>
</td>
<td>
<tab />
</td>
<td1>
<para><text>Jack</text></para>
<para><text>Sarah</text></para>
</td>
</tr1>
<tr>
<td>
<para><text>Bob</text></para>
<para><text>Rita</text></para>
</td>
<td2 colspan="3" with>
<para><text>Helen</text></para>
</td>
</tr2>
<tr>
<td style="with:445px;">
<para><text>Sam</text></para>
</td>
<td>
<para><text>Emma</text></para>
<para><text>George</text></para>
</td>
<td>
</td>
<td3 colspan="">
<tab />
</td>
</tr3>
</table>
/EDITED
I want to find and select the whole last cell together with its start and end tags (<td
and </td>
)
and the end tag of the corresponding row(</tr>
), that is:
EDITED:
Here is what I want to select in the table like above using RegEx:
Either from <td1 to </tr1>
- or from <td2 to </tr2>
- or from <td3 to </tr3>
/EDITED
The format (indentation and new lines have to be preserved), I mean I can't put, for example
</tr>
in front of of closing tag of the cell(</td>
).
Indentation is only space character.
Thanks for any help...