On Jul 8, 2007 Jack Hodgson wrote:

> Will this still work if the "footer" div has another div nested  
> within it?

The expression I wrote won't because it stops when it comes to the first 
</div> after <div id="footer">.

However...

If you have, say this:

<div id="first">somestuff

<div id="second">morestuff

</div>

yetmorestuff</div>

Then you could use the following to change content of divs:

Find:

(<div id="first">)(.|\r)*?(<div 
id="second">)(.|\r)*?(</div>)(.|\r)*?(</div>)

Replace:

\1newstuffone1\3newstufftwo\5newstuffthree\7

It's the same thing only expanded to deal with the situation.

I have changed (.|\r)+? to (.|\r)*? because * means zero or more rather than 
+ which means one or more. With nested divs I think it is very possible that 
there could be nothing at all between some tags, such as </div></div> so 
better to have zero or more characters looked for between them methinks.

-- 
Patrick
<http://www.patrickjames.me.uk>



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