[Regex]Strange pattern?

M

Marcel Stör

Hi,

I'm trying to parse a <table></table> combination out of a HTML string.
Based to my own regex knowledge I defined the pattern as

Dim strTablePattern
strTablePattern = "<table someUniqueAttributes>(.*\r)*?</table>"

to get the first table out of

<table someUniqueAttributes>
<tr>
<td>
.....
</table>
<table>
....
</table>


However, if I apply it to the HTML string I get no matches.


Set HttpObj = Server.CreateObject("AspHTTP.Conn")
HTTPObj.Url = "myUrl"
strOrgContent = HTTPObj.GetURL

Set objRegExp = New RegExp

With objRegExp
..Pattern = strTablePattern
..IgnoreCase = False
..Global = True
End With

Set objMatches = objRegExp.Execute(strOrgContent)
If objMatches.Count > 0 Then
For Each expressionmatched in objMatches
Response.Write "<B>" & expressionmatched.Value & "</B> was matched at
position <B>" & expressionmatched.FirstIndex & "</B><BR>"
Next
End If


If I use the very same pattern in a different programming language I get the
expected results. Any ideas?
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top