私はこの正規表現の問題に悩まされているので、epub ファイルを作成していて、最後にファイルにリンクするための参照がたくさんありますが、今はリンクを返す必要があり、私はIDタグ番号をリンク本文のID番号と一致させる必要があります。正規表現の置換/検索を実行できると思います...
リファレンス 565
<p>Stuff goes here(The reference itself)</p>
<div class="back" style="text-align: justify;">
<a href="../Text/Filename.xhtml#body_ftn2(!!! I need this to match the number of the refferance(thats how the link in text are id'd, same number just body_ftn instead of ftn))">[ →&nbsp;Atgriezties uz piezīmes vietu tekstā ]</a>
</div>
ここで、中間部分を無視する必要があると考えたので、正規表現で少しいじって、これにたどり着きました。参照 (\d+)(?s).*?