' 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.Collections.Generic
Imports System.Text.RegularExpressions

Namespace E
    Public Class Program
        Private Shared ReadOnly re As New Regex("<a\s+[^>]*href\s*=\s*[""']([^""']*)[""'][^>]*>", RegexOptions.Compiled Or RegexOptions.IgnoreCase)
        Public Shared Function LinkParse(html As String) As List(Of String)
            Dim res As New List(Of String)()
            For Each m As Match In re.Matches(html)
                res.Add(m.Groups(1).Value)
            Next
            Return res
        End Function
        Public Shared Sub Main(args As String())
            Dim html As String = "bla bla <a href='foo.html'> bla bla <a href='bar.html'> bla bla"
            Dim links As List(Of String) = LinkParse(html)
            For Each link As String In links
                Console.WriteLine(link)
            Next
        End Sub
    End Class
End Namespace
