View Single Post
Old 03-16-2019, 04:21 PM   #1
meghane_e
Zealot
meghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercise
 
Posts: 114
Karma: 38500
Join Date: Sep 2016
Location: San Jose, CA
Device: Kindle moving to Kobo or Boox
Regex: grabbing <h3><span> tag group

Need help with my regex expression to search <h3.*>(\w.+)</.*></h3> and replace it with <h3>\1</h3>
It was working and caught several of the sections I'm after, but stopped working on the rest. An example it failed on is the blurb below, which looks identical to first few (to me). I'm after the content "3. Escape". Complete blurb I'm looking at:
Quote:
<h3 class="calibre_5"><span class="calibre3"><span class="bold"><a href="http://www.noname.org/forums/story/david-mcleod/thetranslator/3" class="calibre2"><span class="calibre_1"><span class="underline">3. Escape</span></span></a>
</span></span></h3>
It's grabbing all of the following instead of stopping at the first '<' after the content:
Quote:
<h3 class="calibre_5"><span class="calibre3"><span class="bold"><a href="http://www.noname.org/forums/story/david-mcleod/thetranslator/3" class="calibre2"><span class="calibre_1"><span class="underline">3. Escape</span></span></a>
And the Replacement results in this. Note the </span>s and extra </h3>
Quote:
<h3>3. Escape</h3>
</span></span></h3>
Thanks!

Last edited by meghane_e; 03-16-2019 at 04:22 PM. Reason: format
meghane_e is offline   Reply With Quote