I have to try retrieve "Charlotte" from this piece of HTML code, using regex:
<a href="/anime/28999/Charlotte" target="_blank" class="animetitle" title="Anime Information">
<span>Charlotte</span>
</a>
The issue is, I need to get the name "Charlotte" out from the class each and every time, for different titles. Whether this be from the href attribute or the span tags.
I've tried:
<span(?:[^>]+class=\"(.*?)\"[^>]*)?>(.*?)<\/span>
However this only works for the first result it finds. I cannot use a parser at this stage, so any help on this if possible will be very appreciated.
Side note - I'm trying to use this regex under JavaScript.
EDIT: The html is being retrieved through XMLHttpRequest