日期:2014-05-17  浏览次数:20837 次

html的标签怎么转换?
'声明截取的格式,从Start开始截取,到Last为结束
Function   GetKey(HTML,Start,Last)
filearray=split(HTML,Start)
If   UBound(filearray)> 0   Then
filearray2=split(filearray(1),Last)
If   UBound(filearray2)> 0   Then
GetKey=filearray2(0)
Else
GetKey= " "
End   IF
Else
GetKey= " "
End   IF
End   Function


product_Name   =   GetKey(Html,product_Name_start,product_Name_end)   '获取商品名称
一旦从数据库里取出 <title> 就获取不了,数据库里值为 <title> 文本类型
下面这个就可以,我该这么转换下呢?
product_Name   =   GetKey(Html, " <title> ", " </title> ")



------解决方案--------------------
楼主要是的这样的吗?
楼主说的好难理解。。。。
嘿嘿,正则我还用不好,瞎写的。。

str= " <title> 是要取这里的值吗? </title> "
response.write(getkey(str))

function GetKey(str)
if str <> " " then
dim re,return
set re=new regexp
re.pattern= " <title> ([^( <|> )]*?) </title> "
if re.test(str) then return=replace(replace(str, " <title> ", " "), " </title> ", " ") else return= " "
set re=nothing
else
return= " "
end if
getkey=return
end function