' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Text.RegularExpressions

Class MainClass

    Public Shared Sub Main(ByVal args As String())
        test("<a href=""url"">beskrivelse</a>")
        test("<a href=""url1"">beskrivelse1</a><a href=""url2"">beskrivelse2</a>")
    End Sub

    Private Shared Sub test(ByVal s As String)
        Dim res As MatchCollection = Regex.Matches(s, "(?:<a href="")([^""]*)(?:"">)(.*?)(?:</a>)")
        Dim i As Integer
        For i = 0 To (res.Count - 1)
            Console.WriteLine(res(i).Groups(1).Value & " = " & res(i).Groups(2).Value)
        Next
    End Sub
End Class 
