Parsing and extracting all IDs from a document (using regex with capture)
Currently, you're extracting (non-greedily) everything appearing between the IDStart= and &amp;IDEnd. Since this is an ID, and generally the IDs are stored in alphanumeric character sets; you can easily replace the .*? with a [a-z0-9]+ pattern. The &amp; of the &amp;IDEnd will take care of limiting your result between those two words alone.

However, if that is not your case, you should still replace the .*? with .+? so that you won't receive results/captures for a string like: IDStart=&amp;IDEnd.

If the first rule applied to your case, then you can also remove the .Trim call from your GetFristCapture function.

NOTE: I assume that GetFristCapture is a typo. If not, you should rename it to GetFirstCapture.

The the GetFristCapture function itself, do not create a temporary variable. Just return from the if block itself:

Public Function GetFristCapture(m As Match) As String
    ' Gets the first group capture "(...)" in a regex match.
    ' Returns empty string if not a match or there is no group capture found
    If m IsNot Nothing AndAlso m.Success AndAlso m.Groups.Count &gt; 1 Then
        ' Note: The first group is the entire match itself,
        ' so Group(1) is what we want, not Group(0)
        return m.Groups(1).Value
    End If
    Return ""
End Function


Note that I removed the nested if block as well. With your condition m.Groups.Count &gt; 1, you're obviously getting Group(0) and Group(1). Just return Group(1) from there.