Hi Guys,
What i'm doing here is calling a function that uses regex to search a page for values, using the following code:
I call it like:
And then add it to a listbox like:
I can messagebox.show the results out fine in the function but only 1 value is returned when i do Return newValue instead of 2, so 2 matches are found each run but only 1 returned i cannot think of how to do it!
any help would be great guys
cheers
Graham
What i'm doing here is calling a function that uses regex to search a page for values, using the following code:
Code:
Private Function returnCF(ByVal html As String) As String
Dim newValue As String = String.Empty
'// SET THE PATTERN
Dim pattern As String = "13pt;""><b>(.*)"
Dim rx As New Regex(pattern, RegexOptions.IgnoreCase Or RegexOptions.Compiled)
'// LOOP THE MATCHES OUT
Dim mc As MatchCollection = Regex.Matches(html, pattern)
For Each m In mc
'// CLEAN UP
Dim splitFlow As String() = m.ToString.Split(">"c)
newValue = splitFlow(2)
messagebox.show(splitFlow(2).tostring) <-- This pops up both values that i need.
Next
Return newValue
End Function
I call it like:
Code:
Dim CF As String = returnCF(html)
Code:
ListBoxMain.Items.Add(CF)
any help would be great guys
cheers
Graham