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