View Single Post
Old 08-18-2024, 09:45 AM   #1
KarlG
Connoisseur
KarlG began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Mar 2024
Device: none
Possible RegEx error in Sigil (minimal match being ignored)

Hello,

I'm trying to delete all 'span' tags with no content (i.e. <span blah blah>(nothing here)</span> by using the following RegEx (with minimal match enabled)

<span .*></span>

Here is some example text which shouldn't match anything

<hgroup><h2 class="CHAPTER" id="ch1"><span class="CN"><samp class="SANS_Futura_Std_Bold_Condensed_B_11">1</samp></span> <span class="CT"><samp class="SANS_Dogma_OT_Bold_B_11">WINDOWS FOUNDATIONAL CONCEPTS</samp></span></h2></hgroup>

As we can see, there are no span tags without content. Running this RegEx however matches the following text (as can be seen in the attached screenshot)
<span class="CN"><samp class="SANS_Futura_Std_Bold_Condensed_B_11">1</samp></span>

Is there anything I have missed, or is this indeed an error?

Rgds

Karl
Attached Thumbnails
Click image for larger version

Name:	regex error.png
Views:	287
Size:	22.3 KB
ID:	210250  
KarlG is offline   Reply With Quote