Having read a number of forum posts, and online examples I thought the below would give me the ‘table’ within a HTML page returned from a socket to data (the text is in data fine). Instead it gives me no match;
Dim rg As New RegEx
Dim myMatch As RegExMatch
rg.SearchPattern="<table>(.*?)<\/table>"
myMatch = rg.Search(data)
If myMatch <> Nil Then
txtdata.Text = myMatch.SubExpressionString(0)
'html.LoadPage(mymatch)
Else
txtdata.Text = "Text not found!"
End If
Exception err As RegExException
MsgBox(err.Message)
.* will stop at the end of the line unless you change options/switches, so my guess is you’re trying to match against multiple lines. Try [\s\S]* instead. (That’s one of a few solutions.)
Thanks as always Kem, that works perfectly, although sadly I am no nearer understanding the vagaries of regex, perhaps I need to find a book on the subject.