Regular expressions Problem

M

Michael Persaud

Hello,

I am trying to use the following in a project to identify a table that is ided="news of the day"

Function readHtmlPage(url As String) As String

result = ....'as string


dim regexp as regex = New Regex("<table>((.|\n)News of(*?))</table>", RegexOptions.IgnoreCase)


dim str as string
Dim objMatch as Match
For Each objMatch in regexp.Matches(result)
Str= objMatch.ToString()
Next
return str'result

But its not getting anything. Please let me know what is wrong with getting the "News of " string

Thanks
MP
 
M

Michael Persaud

I figured that the problem was i dint import the namespace

My other issue is that i need to replace the results if there is any href=
to something else ???

any suggestions appreciated


Thanks



Hello,

I am trying to use the following in a project to identify a table that is
ided="news of the day"

Function readHtmlPage(url As String) As String

result = ....'as string


dim regexp as regex = New Regex("<table>((.|\n)News of(*?))</table>",
RegexOptions.IgnoreCase)


dim str as string
Dim objMatch as Match
For Each objMatch in regexp.Matches(result)
Str= objMatch.ToString()
Next
return str'result

But its not getting anything. Please let me know what is wrong with getting
the "News of " string

Thanks
MP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top