28,391
社区成员
发帖
与我相关
我的任务
分享
Function getText(fString, patrn,n)
dim Matches, tStr
tStr = fString
Set re = New Regexp
re.IgnoreCase = True
re.Global = True
re.Pattern = patrn
set Matches = re.Execute(tStr)
set re = nothing
rStr = ""
For Each Match in Matches
rStr = Match.SubMatches(n)
exit for
Next
getText = rStr
End Function
dim Matches
sub setMatches(str,sRe)
Set re = New Regexp
re.IgnoreCase = True
re.Global = True
re.Pattern = sRe
set Matches = re.Execute(str)
set re=nothing
end sub
Html3=" <a target=""_blank"" href=""../../play.asp?id=2006&m=2&n=1&u=1&v=1""> [第01集] </a> <a target=""_blank"" href=""../../play.asp?id=2006&m=2&n=2&u=1&v=1""> [第02集] </a> "
pattern="<a[^>]*?>"
call setMatches(Html3,pattern)
For Each Match in Matches
response.write getText(Match.value, "href=""([^""]*?)""", 0) + "<br>"
Next