A pair of <td></td> tags across multiple lines
between which is an anchor <a> </a> which can contain any text and which may also be across multiple lines.
I can find parts of what I want but have been unable to put together the parts to find the whole.
Use (?s) to allow . to match line breaks. For example:
(?s)<td>.*?</td>
— Jim
SEARCH : (<tr[^>]*>)((<td[^>]*>[^<]+</td>[\s]*){2,2})(<td[^>]*>[^<]+</td>)
REPLACE : \1\2
(<tr[^>]*>)
((<td[^>]*>[^<]+</td>[\s]*){2,2})
(<td[^>]*>[^<]+</td>)
line 4 traps for either :
<tr>
<tr class="pred">
lines 5, traps for any combination :
<td> ... </td><td> ... </td>
<td> ... </td><td class="pblue"> ... </td>
<td class="pblue"> ... </td><td class="pblue"> ... </td>
<td class="pblue"> ... </td><td> ... </td>
This example has five columns, but you could have more (not valid html)
<tr><td> column 1 </td>
<td> and column 2 </td><td> and
column 3
</td><td> and column 4</td><td> column 5</td>
</tr>
<tr class="pred"><td class="pblue"> column 1 </td><td> column 2 </td><td> and
column 3
and more</td><td> column 4</td><td> column 5</td>
</tr>
<tr><td> column 1</td><td>and column 2</td><td> and
column 3
and more</td><td class="pblue"> and
column
4 and
more</td><td> column 5</td>
</tr>
Will yield this (all column 3's are gone):
<tr><td> column 1 </td>
<td> and column 2 </td><td> and column 4</td><td> column 5</td>
</tr>
<tr class="pred"><td class="pblue"> column 1 </td><td> column 2 </td><td> column 4</td><td> column 5</td>
</tr>
<tr><td> column 1</td><td>and column 2</td><td> and
column
4 and
more</td><td> column 5</td>
</tr>
Best Regards,
Bill Hernandez
Plano, Texas
Using the same (?:(?!</td>).)* trick as in my previous email...
Find
(?s)<td[^>]*>(?:(?!</td>).)*<a[^>]*>(?:(?!</a>).)*</a>(?:(?!</td>).)*</td>
Ronald