View Single Post
Old 11-27-2020, 12:01 AM   #9
jjk
Enthusiast
jjk began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Aug 2018
Location: Paris (France)
Device: Kobo Kindle Vivlio-Inkpad3
Code:
"chapter(\d+)[^\[]+\[\K(\d+)
Here, this EbookMakers' code is working :
Code:
<span class="Footnoteanchor"><a epub:type="noteref" href="chapter65.xhtml#ftn1" id="bodyftn1">[1]</a></span>
<span class="Footnoteanchor"><a epub:type="noteref" href="chapter65.xhtml#ftn1" id="bodyftn1">[2]</a></span>
<span class="Footnoteanchor"><a epub:type="noteref" href="chapter66.xhtml#ftn1" id="bodyftn1">[1]</a></span>
<span class="Footnoteanchor"><a epub:type="noteref" href="chapter66.xhtml#ftn1" id="bodyftn1">[2]</a></span>
<span class="Footnoteanchor"><a epub:type="noteref" href="chapter66.xhtml#ftn1" id="bodyftn1">[3]</a></span>
<span class="Footnoteanchor"><a epub:type="noteref" href="chapter67.xhtml#ftn1" id="bodyftn1">[1]</a></span>
<span class="Footnoteanchor"><a epub:type="noteref" href="chapter67.xhtml#ftn1" id="bodyftn1">[2]</a></span>
<span class="Footnoteanchor"><a epub:type="noteref" href="chapter68.xhtml#ftn1" id="bodyftn1">[1]</a></span>
@Roger64 : you have to execute that R/R in one shot, that is All replace, on current file or all html files for example.

@EbookMakers : thanks for your code.
I learnt at least two things :
1) \K which resets the starting point of the reported match
2) using of a rather simple Regex-function
jjk is offline   Reply With Quote