I got some Text withing the EPUB as follows:
I'm going to replace the tags:
Replace: <span class="footnote">\1</span>
Regex.dotall, All Html-Files
There are about 100 positions to be changed in the EPUB. I used a step by step replace. Far too late i discovered, that sometimes the replacement is just "<span class="footnote">\1</span>". (\1 is not replaced with the contents of the group.)
After all i counted and found 30 occourrences, where the reference to the group was not resolved.
This will only happen in a "step by step" s/r, not with "replace all"