'================================================
'函数名:findmatch
'作 用:截取相匹配的内容
'返回值:截取后的字符串
'================================================
public function findmatch(byval str, byval start, byval last)
dim match
dim s
dim filterstr
dim matchstr
dim strcontent
dim arrayfilter()
dim i, n
dim brepeat
if len(start) = 0 or len(last) = 0 then exit function
on error resume next
matchstr = "(" & correctpattern(start) & ")(.+?)(" & correctpattern(last) & ")"
dim re
set re = new regexp
re.ignorecase = true
re.global = true
re.pattern = matchstr
set s = re.execute(str)
n = 0
for each match in s
if n = 0 then
n = n + 1
redim arrayfilter(n)
arrayfilter(n) = match
else
brepeat = false
for i = 0 to ubound(arrayfilter)
if ucase(match) = ucase(arrayfilter(i)) then
brepeat = true
exit for
end if
next
if brepeat = false then
n = n + 1
redim preserve arrayfilter(n)
arrayfilter(n) = match
end if
end if
next
set s = nothing
set re = nothing
strcontent = join(arrayfilter, "|||")
strcontent = replace(strcontent, start, "")
strcontent = replace(strcontent, last, "")
findmatch = replace(strcontent, "|||", vbnullstring, 1, 1)
exit function
end function
private function correctpattern(byval str)
str = replace(str, "", "")
str = replace(str, "~", "~")
str = replace(str, "!", "!")
str = replace(str, "@", "@")
str = replace(str, "#", "#")
str = replace(str, "%", "%")
str = replace(str, "^", "^")
str = replace(str, "&", "&")
str = replace(str, "*", "*")
str = replace(str, "(", "(")
str = replace(str, ")", ")")
str = replace(str, "-", "-")
str = replace(str, "+", "+")
str = replace(str, "[", "[")
str = replace(str, "]", "]")
str = replace(str, " str = replace(str, ">", ">")
str = replace(str, ".", ".")
str = replace(str, "/", "/")
str = replace(str, "?", "?")
str = replace(str, "=", "=")
str = replace(str, "|", "|")
str = replace(str, "$", "$")
correctpattern = str
end function
'================================================
'函数名:gethttppage
'作 用:获取http页
'参 数:url ----远程url
'返回值:远程html代码
'================================================
public function getremotedata(byval url)
cset = "gb2312"
dim strheader
dim l
on error resume next
dim retrieval
dim objstream
set objstream = createobject("adodb.stream")
objstream.type = 1
objstream.mode = 3
objstream.open
set retrieval = createobject("msxml2.xmlhttp")
with retrieval
.open "get", url, false
.setrequestheader "referer", url
.send
if .readystate 4 then exit function
if .status > 300 then exit function
'--获取目标网站文件头
strheader = .getresponseheader("content-type")
strheader = ucase(strheader)
objstream.write (.responsebody)
end with
set retrieval = nothing
if len(strheader) > 0 then
'--获取目标文件编码
l = instrrev(strheader, "charset=", -1, 1)
if l > 0 then
cset = right(strheader, len(strheader) - l - 7)
else
cset = cset
end if
end ifobjstream.position = 0
objstream.type = 2
objstream.charset = trim(cset)
getremotedata = objstream.readtext
objstream.close
set objstream = nothing
exit function
end function
%>
fromurl = "https://www.111cn.net"aa = trim(request.form("aa"))
bb = trim(request.form("bb"))
if aa"" and bb"" then response.write findmatch(getremotedata(fromurl),aa,bb)
%>
长途巴士模拟器手机版
长途巴士模拟器汉化版是一款十分比真好玩的大巴车模拟驾驶运营类
房东模拟器最新版2024
房东模拟器中文版是一个超级有趣的模拟经营类型的手游,这个游戏
原神祈愿模拟器最新版
原神祈愿模拟器手机版是一款完整汉化的趣味原神抽卡模拟小游戏,
宝宝森林美食完整版
宝宝森林美食游戏最新版是一款十分有趣的休闲益智游戏,帮助宝宝
g沙盒仇恨官方英文版(gorebox)
G沙盒仇恨英文原版是一款最近非常火热的沙盒模拟类游戏,在这里