Hi,
Your expression is correct. Use a
Match
to get the news from the HTML tags. First, add this at the top of your code file:
Imports System.Text.RegularExpressions
Then, use this code to get the news from the HTML tags:
Dim newsAndHtmlTags As String = "<p><div id=""newsItem"">This is news!</div></p>"
Dim pattern As String = "(?<=(<div id=""newsItem"">)).*?(?=(</div>))"
Dim match As System.Text.RegularExpressions.Match = Regex.Match(newsAndHtmlTags, pattern)
Dim news As String = match.Value
Hope this helps.