I have a function to extract items from a web page. I use Match.NextMatch() within a loop. However, the code appends each item extracted from the source document TWICE. It is as if the Match.Value string is not cleared until you append it. Here is the function:
Private Function ExtractItemFromPage(sSource as String) As Boolean Dim expr As New Regex("\b\d{3}\s\d{3}-\d{4}") '-- Get phone number -- Dim m As Match = expr.Match(sSource) Do While m.Success
txtPhoneNums.AppendText(m.Value & vbCrLf)
m = m.NextMatch
Loop Return TrueEnd Function
Why is this appending the same number twice Do I need to call some function to clear the value of m.Value before I call NextMatch()