Thread: Regex examples
View Single Post
Old 09-25-2012, 09:01 AM   #130
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Strange issue

Most surely, I'm not understanding this the right way.

I'm cleaning up some epubs and have noticed that some of them have anchor tags with a class and an id but without any hyperlink. Some epubs have several hundred in between the text.

So I'm using this regex to find anchor links with nothing inside them

Quote:
<a class="(.*?)" id="(.*?)"></a>
The problem is that it also finds these tags with spans and even text inside.

I would like to be able to restrict the findings to only this situation.

Many thanks!
paulfiera is offline   Reply With Quote