G
Guoqi Zheng
Sir,
I am writing a script to remove html tag using Regular expression.
For example, I have a string = "<td class="whatever" width=12>some content
here</td>"
What I want to return is "<td class="whatever" width=12>", I used pattern =
"<td(.*)>"
However instead of returning "<td class="whatever" width=12>"
it returns "<td class="whatever" width=12>some content here</td>"
Below is my code, what did I do wrong here?
Dim webPage As String = GrabUrl()
Dim abc As ArrayList = New ArrayList
RichTextBox1.Text = webPage
Dim TagExpression As New Regex("<td(.*)>", RegexOptions.IgnoreCase)
Dim mc As RegularExpressions.MatchCollection
mc = TagExpression.Matches(webPage)
Dim m As Match
For Each m In mc
abc.Add(m.Groups(0))
Next
ListBox1.DataSource = abc
--
Kind regards
Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com
I am writing a script to remove html tag using Regular expression.
For example, I have a string = "<td class="whatever" width=12>some content
here</td>"
What I want to return is "<td class="whatever" width=12>", I used pattern =
"<td(.*)>"
However instead of returning "<td class="whatever" width=12>"
it returns "<td class="whatever" width=12>some content here</td>"
Below is my code, what did I do wrong here?
Dim webPage As String = GrabUrl()
Dim abc As ArrayList = New ArrayList
RichTextBox1.Text = webPage
Dim TagExpression As New Regex("<td(.*)>", RegexOptions.IgnoreCase)
Dim mc As RegularExpressions.MatchCollection
mc = TagExpression.Matches(webPage)
Dim m As Match
For Each m In mc
abc.Add(m.Groups(0))
Next
ListBox1.DataSource = abc
--
Kind regards
Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com