Thread: Regex examples
View Single Post
Old 03-08-2014, 12:02 PM   #316
John Doe
Junior Member
John Doe began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2014
Device: Android
Thanks! It seems that I just got my self some bedtime reading

Now, if I want to search for something like the above, but dont know how much text there is, how do I do that?

Example:

I search for this:

Code:
<p><a id="id1">This is the text that is in the note and I dont know how much there is. It changes for every note.</a><br /></p>
And want to replace it with this:

Code:
<aside epub:type="footnote">
    <div epub:type="footnote" id="id1"><br />
      <p>This is the text that is in the note and I dont know how much there is. It changes for every note.</p>
    </div>
</aside>
The ID numbers is quite easy after your help, but how do I search and replace the rest without changing the note? I want to replace everything around the note, but the text between "<p>" and "</p>" can be changing from note to note.
John Doe is offline   Reply With Quote