View Single Post
Old 12-06-2012, 03:50 PM   #5
Danger
Evangelist
Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.
 
Danger's Avatar
 
Posts: 486
Karma: 1665031
Join Date: Nov 2010
Location: Vancouver Island, Nanaimo
Device: K2 (retired), Kobo Touch (passed to the wife), KGlo, Galaxy TabPro
This is one I use for most of my search and replace where there is a start and end tag or character (such as quotes):

Find: (?s)<div(.*?)</div>
Replace: <p\1</p>

Things I have learned from those more familiar with Regex and Sigil than myself:
(?s) search over multiple lines
(.*?) look for whatever comes after this and stop at first instance found. In the above, look for the </div> and stop the search at the very 1st one found. Without this I have had instances where it does not stop at the first instance found but have ended up with 2 or 3 paragraphs and sometimes the entire chapter highlighted.
Danger is offline   Reply With Quote