<%
hehe = hello ("http://mmsg.qq.com/cgi-bin/gddylist?type=13&sort=1&page=3", "<html>", "</html>", ".*(<tdwidth =" " 35%"" bgcolor = ""#[/dabcde] {6} ""> (.*) </td>) [./ n]*"," <fontstyle = "" font-size: 9pt; "" cor = azul> $ 2 </font> <br> ")
Response.writehehe
FunctionHello (Strurl, Strstart, Strandrend, Patrn, Replstr)
Str = getBody (strurl)
Str = mymid (str, strstart, sequência)
STR = Replactest (Patrn, Replstr, Str)
Olá = str
Função final
Functionmid (str, strstart, sequência)
Ifstrstart = "" então
i = 0
Outro
i = instrum (str, strstart)
Endif
Ifstrend = "" então
j = len (str)
Outro
j = instrum (i, str, sequência)
Endif
Mymid = MID (str, i, j-i+1)
Função final
FunctionReplacetest (patn, replstr, str1)
Dimregex, corresponde, corresponde
SetRegex = newRegexp
regex.pattern = patn
regex.IGNORECASE = true
regex.global = true
SetMatches = regex.execute (str1)
ForeachMatchinMatches
Replactest = replactest®ex.replace (match.value, replststr)
Próximo
Função final
FunctionGetBody (URL)
SetObjxml = CreateObject ("Microsoft.xmlHttp")
Withobjxml
.Popen "Get", URL, False, "", ""
.Enviar
GetBody = .ResponseBody
ENDWITH
GetBody = bytestobstr (getbody, "gb2312")
Setobjxml = nada
Função final
FunctionByTestobstr (Strbody, CodeBase)
Setobjstream = server.createObject ("adodb.stream")
Withobjstream
.Type = 1
.Mode = 3
.Abrir
.Writestbody
.Position = 0
.Type = 2
.CharSet = CodeBase
Bytestobstr = .readText
.Fechar
ENDWITH
Setobjstream = nada
Função final
%>
其他调用示例
hehe = hello ("http://list.mp3.baidu.com/song/a.htm", "<tabelawidth =" "90%" "border =" "0" "align =" "central" "" f5f5f "3" "" "" "" "" "" "" "" "" "" "" "" " , "<Divalign = Center>", ".*(<Tdwidth =" "20%" "> <ahref =" ".*/. Htm" "alvo = _blank>) (.*) (</a> </td>) [./ n]*", <fontyle = "" "FONT-SIZE: 9pt;