View Single Post
Old 07-22-2023, 05:54 AM   #1
repilo
Connoisseur
repilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmos
 
Posts: 96
Karma: 21870
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
Nested span, clean

Please, how can I, using regex, select the text between an opening tag of a div or span and its corresponding closing tag, without confusing it with the closing of another element nested inside it?
I would like to remove "span" tags without causing errors, i.e. taking into account other "span" tags nested inside them, for example in:
Code:
<span class="txt">Lorem <span class="italic">ipsum</span> dolor</span>
Can this be done via regex with Sigil?
The best I know how to do so far is:
Search: <span class="txt">([^<]+)</span>
Replace: \1
Thanks for your help.
repilo is offline   Reply With Quote