I really have serious problems with regex. I need to get all text between 2 strings, in this case that strings are <
Your text is xml
, so why to hack a strings with Regex
if you can do it in readable and clear way.
With LINQ to XML
Dim htmlPage As XDocument = XDocument.Parse(downloadedHtmlPage)
Dim className As String = "user user-role-registered-member"
Dim value As String =
htmlPage.Descendants("span").
Where(Function(span) span.Attribute("class").Value.Equals(className)).
FirstOrDefault().
Value
And with Accessing XML in Visual Basic
Dim htmlPage As XDocument = XDocument.Parse(downloadedHtmlPage)
Dim className As String = "user user-role-registered-member"
Dim value As String =
htmlPage....
Where(Function(span) span.@class.Value.Equals(className)).
FirstOrDefault().
Value