At 8:19 AM -0700 1/29/07, Warren Michelsen wrote:
I'm trying to use a grep find to eliminate the last column in a table. I'm not able to get grep to find the last instance of <td.*</td> before a </tr>.

<td.*
will find the opening tag
and
.*</tr>  will find just the row closing tag but

<td.*</td>
will not find the entire column.

That's because . doesn't match a newline. Use something like [\s\S]* or the pattern modifier (?s).

I'd thought I could find something like:
<td.*</td>.*</tr>
and replace it with </tr>

The table has hundreds of lines and I'd like to use find/replace but I obviously don't know the correct pattern to find that last column.

The other problem you'll run into is greedy searches. See the BBEdit help page on grep for details, but you want something like this (not tested):

(?s)<td.*?</td>.*?</tr>
--
/Jonathan Lundell.

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to