View Single Post
Old 04-16-2013, 01:15 AM   #1
lissie
Enthusiast
lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.
 
Posts: 30
Karma: 502132
Join Date: May 2011
Device: Kindle3
Struggling with regex over multiple lines

Okay I'm not the best with regex but I know this must be possible. I have a book with hundreds of footnotes. Some of the footnotes are a page long! I want to add a "return to text" hyperlink at the bottom of each footnote.

Each footnote will have one or many paragraphs. Some have images as well.

I want to go from this:
Code:
<div id="edn1">
<p class="someclass"><a href="#_ednref1" name="_edn1" title="">[1]</a>Footnote #1 and some words </p>
<p class="someclass">And another paragraph of footnote 2</p>
</div>
To this:
Code:
<div id="edn1">
<p class="someclass"><a href="#_ednref1" name="_edn1" title="">[1]</a>Footnote #1</p>
<p class="someclass">And another paragraph of footnote 1 but only sometimes</p>
<p class="someclass"><a href="#_ednref1">Return to Text</a></p>
</div>
I'm using notepad++ which AFAIK uses standard regex search/replace functions
lissie is offline   Reply With Quote