Ronald, you're a genius. Many thanks. I just did in two seconds what it
took all morning to do before I asked the question.
John
Custom Communications, Inc.
145 Newbury St.
Portland, ME 04101
207-771-5510
www.desktoppub.com
On May 11, 2006, at 12:30 PM, BBEdit-Talk List wrote:
From: Ronald J Kimball <[EMAIL PROTECTED]>
Date: May 11, 2006 10:37:05 AM EDT
Subject: Re: Can BBEdit do this?
On Thu, May 11, 2006 at 10:31:58AM -0400, John Gold wrote:
In a bit of utter stupidity, I've created a 500+ page web site in
which
the <TITLE> section is completely generic, as in:
<TITLE>This is the city website</TITLE>
On every page. Duh.
Not very good for search engines, or for my indexing software.
However, in the body of each page, I do have a headline, consistenly
coded, as in:
<span class="title">This is the headline</span>
What I'd like to do, is build a search and replace that will take the
contents of the headline and place them in the title area on each
page.
Can this be done with a Grep search? Any suggestions?
Or should I just start copying and pasting....
Try this:
Find
(?s)(<TITLE>).*?(</TITLE>.*?<span class="title">)(.*?)(</span>)
Replace
\1\3\2\3\4
The (?s) allows . to match newline, since your HTML is presumably
across
multiple lines. :)
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]>