I have a huge scanned file (500,000+ words) I'm converting into an ebook. I've got the text more or less converted. I'm now dealing with nearly a thousand footnotes. I don't want to have to hand-code all of the buggers so that they link from the reference to the note and back. I've got all of the note references with code ready to go--they all currently read
Code:
<sup><a href="" name"">NUMBER</a></sup>
(where NUMBER is, obviously, an integer -- the note number).
What I want to do is use a regular expression to help fill in the blanks, so that it looks like this:
Code:
<sup><a href="../Text/Foreword.xhtml#noteNUMBER" name="refNUMBER">NUMBER</a></sup>
Here's the search I tried:
Code:
<sup><a href="" name="">(.*)</a></sup>
And here's my attempted regex:
Code:
<sup><a href="../Text/Foreword.xhtml#note\1" name="ref\1">\1</a></sup>
Unfortunately, when I do get it to work at all, it only finds the first footnote, and munges the code:
Code:
<sup><a href="../Text/Foreword.xhtml#note1"</a></sup>
Any suggestions? Help?
ETA: Okay. Forgot the ? to make the asterisk lazy:
Code:
<sup><a href="" name="">(.*?)</a></sup>
But now the search just crashes the application.