Hi,
I have the following HTML:
On this code, I use the following RegEx:
The intent is to return a match for each table header (where there is text in the header). However, it's not quite right.
The first to 5th match are as expected. However, the 6th match includes the empty table header as well as the next one with text, i.e.:
From my expression, I understand why the bold area is being returned but I don't want it to be!
I'd be really grateful for any suggestions.
Thanks,
Graeme
"Just beacuse you're paranoid, don't mean they're not after you
I have the following HTML:
Code:
<tr>
<th class="TableCaption" align="center" valign="top" bgcolor="#f2f2f2" width="20%">
Time CET
</th>
<th class="TableCaption" align="center" valign="bottom" bgcolor="#f2f2f2" width="10%">
CH>AT
</th>
<th class="TableCaption" align="center" valign="bottom" bgcolor="#f2f2f2" width="10%">
CH>DE
</th>
<th class="TableCaption" align="center" valign="bottom" bgcolor="#f2f2f2" width="10%">
CH>FR
</th>
<th class="TableCaption" align="center" valign="bottom" bgcolor="#f2f2f2" width="10%">
CH>IT
</th>
<th class="TableCaption" bgcolor="#e0e0e0"></th>
<th class="TableCaption" align="center" valign="bottom" bgcolor="#f2f2f2" width="10%">
AT>CH
</th>
<th class="TableCaption" align="center" valign="bottom" bgcolor="#f2f2f2" width="10%">
DE>CH
</th>
<th class="TableCaption" align="center" valign="bottom" bgcolor="#f2f2f2" width="10%">
FR>CH
</th>
<th class="TableCaption" align="center" valign="bottom" bgcolor="#f2f2f2" width="10%">
IT>CH
</th>
</tr>
On this code, I use the following RegEx:
Code:
Regex borderRegex = new Regex("<th.*>(?<data>[\\S\\s\\w\\w>\\w{1}\\S\\s]*?){1}</th>", RegexOptions.Multiline);
The intent is to return a match for each table header (where there is text in the header). However, it's not quite right.
The first to 5th match are as expected. However, the 6th match includes the empty table header as well as the next one with text, i.e.:
Code:
[b]"<th class=\"TableCaption\" bgcolor=\"#e0e0e0\"></th>[/b]\n<th class=\"TableCaption\" align=\"center\" valign=\"bottom\" bgcolor=\"#f2f2f2\" width=\"10%\">\n\t\t\t\t\t\t\t\t\t\tAT>CH\n\t\t\t\t\t\t\t\t\t</th>"
From my expression, I understand why the bold area is being returned but I don't want it to be!
I'd be really grateful for any suggestions.
Thanks,
Graeme
"Just beacuse you're paranoid, don't mean they're not after you