Need help writing a string pattern
Posted: Tue Jun 25, 2002 1:49 pm
I am trying to use ereg_repalce to get rid of the LAST column from an html table, but cannot figure out the proper string pattern syntax.
The beginning of the pattern is "<td width". Since this is the last column I want to delete, I would use "</tr>" as the ending part.
I tried using "<td w([^>]|\n)*tr>" but that didn't work. I think I am getting problems with the carriage returns in the HTML and the extra < and > too.
So,
would become
Thanks!
The beginning of the pattern is "<td width". Since this is the last column I want to delete, I would use "</tr>" as the ending part.
I tried using "<td w([^>]|\n)*tr>" but that didn't work. I think I am getting problems with the carriage returns in the HTML and the extra < and > too.
So,
Code: Select all
...
</td>
<td width="19%" valign="TOP">
<b>ANY HTML HERE</b>
</td>
</tr>
<tr>
...would become
Code: Select all
...
</td>
<!-- LAST COLUMN DELETED -->
</tr>
<tr>
...