On Wed, Jun 07, 2006 at 06:56:11PM -0700, Michael Heth wrote:

> Is it possible to use grep to do the following?
> 
> find
> 
> <!-- begin header -->
> 
> all kinds of HTML here
> 
> <!-- end header -->
> 
> and replace with
> 
> <!-- begin header -->
> 
> new HTML here
> 
> <!-- end header -->
> 
> using the HTML comment tags as the delimiters.
> 
> And if the answer is yes, is there anyone who would be nice enough to  
> list the grep terms to get it to work?

Yes, that's a straightforward search and replace.

Find

<!-- begin header -->(?s:.*)<!-- end header -->

Replace

<!-- begin header -->

new HTML here

<!-- end header -->


(?s) allows . to match newlines.


Ronald

-- 
------------------------------------------------------------------
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