aspN00b
07-05-2009, 02:43 AM
Hi there,
This is my first post. I normally program in Python and I've been asked to modify an ASP script. It's not going well :(
I would like to make an analogous statement to this python statement in ASP:
tags = re.findall('(<div>)(.{0,255})(</div>)', mainurl)
for tag in tags:
print tag[1]
I tried this to no avail :( :
Dim response(20)
Dim matchposition(2)
Dim regEx
Dim Matches
' Create a new Regex object and define the regular expression.
Set regEx = new RegExp
regEx.Pattern = "((<div>)(.{0,100})(</div>))"
' Use the Matches method to find all matches in the input string.
'MatchCollection mc = re.Matches(description)
Matches = regEx.Execute(description)
Response.Write Matches
' Loop through the match collection to retrieve all
' matches and positions.
Dim i
For i = 0 To mc.Count - 1
' Add the match string to the string array.
results(i) = mc(i).Value
Response.Write mc(i).Value
' Record the character position where the match was found.
matchposition(i) = mc(i).Index
Next i
This is my first post. I normally program in Python and I've been asked to modify an ASP script. It's not going well :(
I would like to make an analogous statement to this python statement in ASP:
tags = re.findall('(<div>)(.{0,255})(</div>)', mainurl)
for tag in tags:
print tag[1]
I tried this to no avail :( :
Dim response(20)
Dim matchposition(2)
Dim regEx
Dim Matches
' Create a new Regex object and define the regular expression.
Set regEx = new RegExp
regEx.Pattern = "((<div>)(.{0,100})(</div>))"
' Use the Matches method to find all matches in the input string.
'MatchCollection mc = re.Matches(description)
Matches = regEx.Execute(description)
Response.Write Matches
' Loop through the match collection to retrieve all
' matches and positions.
Dim i
For i = 0 To mc.Count - 1
' Add the match string to the string array.
results(i) = mc(i).Value
Response.Write mc(i).Value
' Record the character position where the match was found.
matchposition(i) = mc(i).Index
Next i