I'm trying to match a tag values (music kind styles) of an xml.
This are some examples:
One music genre: (Pop) (rel="tag">Pop)
<span class="genres"><a href="http://www.mp3crank.com/genre/shoegaze" rel="tag">Pop</a></span>
Two music genres: (Reggae) (Ska) (rel="tag">Reggae) (rel="tag">Ska)
<span class="genres"><a href="http://www.mp3crank.com/genre/reggae" rel="tag">Reggae</a> / <a href="http://www.mp3crank.com/genre/ska" rel="tag">Ska</a></span>
More than two music genres: (Alternative) (Indie) (Rock) (rel="tag">Alternative) (rel="tag">Indie) (rel="tag">Rock)
<span class="genres"><a href="http://www.mp3crank.com/genre/alternative" rel="tag">Alternative</a> / <a href="http://www.mp3crank.com/genre/indie" rel="tag">Indie</a> / <a href="http://www.mp3crank.com/genre/rock" rel="tag">Rock</a></span>
What I need is to obtain the "Genre" values to append it in a variable:
rel="tag">Genre</a>
...or better if I can obtain "Genre" without the rel="tag"> part, but really no matter.
This is the RegEx I did, is not working good, Is only matching the first tag even if exist two or more genre tags.
Dim RegEx_AlbumStyle As New Regex(<a><![CDATA[rel=.+</a>\s?[^><]|rel=.+</a>]]></a>.Value)
This is the code:
Dim AlbumStyle as string
Dim RegEx_AlbumStyle As New Regex(<a><![CDATA[rel=.+</a>\s?[^><]|rel=.+</a>]]></a>.Value)
If Line.Contains(<a><![CDATA[<span class="genres">]]></a>.Value) Then
For Each Style In RegEx_AlbumStyle.Match(Line).Groups
MsgBox("match:" & Style.ToString)
' I need to append all found matches to a string variable
' AlbumStyle += ", " & Style.ToString
' But I only find one match even if exists more than one genre value in the string
Next
End If