View Single Post
Old 04-16-2013, 02:21 PM   #4
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Ok I tested on your example, hopefully it works on others:

Search:

Code:
<div id="([^"]+)">\s*<p([^>]+)><a href="([^"]+)"([^>]+)>(.*)</div>
Replace:

Code:
<div id="\1"><p\2><a href="\3"\4>\5<p\2><a href="\3">Return to Text</a></p></div>
NOTE: I had a whole color coordinated post to try to explain it more in depth, but there were too many capture points and I thought it would be a little confusing. If you need a more in depth explanation, I would not mind breaking it down for you.

As a side note, I personally think that a "Return to Text" link is a little hideous (the original footnote should point right back to where you came from).

Quote:
Originally Posted by mzmm View Post
there's probably an option to turn on 'dot matches new line' in the search/replace field which you should use. might have to play around with it to get it working properly but hope it's helpful
Yes, put a checkbox in "dot matches newline", that will allow the red part to capture everything until the </div>.
Tex2002ans is offline   Reply With Quote