最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 获取字符串中url地址函数
时间:2022-06-29 13:49:10 编辑:袖梨 来源:一聚教程网
on error goto z
'
dim url,key,wwwname
url=request.servervariables("server_name")
if instr(url,".")>0 then
key=split(url,".")
wwwname=key(0)
wwwname=replace(wwwname,"http://","")
end if
response.write(wwwname)
'方法二
'vb.net:
public shared function isurl(byval strtmp as string) as boolean
on error goto z
dim objintpattern as new system.text.regularexpressions.regex( "^(http://|https教程://){0,1}[a-za-z0-9][a-za-z0-9-.]+[a-za-z0-9].[a-za-z]{2,}[#-~]*$")
return objintpattern.ismatch(strtmp)
z:
end functionprivate sub button1_click(byval sender as system.object, byval e as system.eventargs) handles button1.click
msgbox (isurl( "http://www.sohu.com"))
'方法三
dim objintpattern
isurl = false
set objintpattern = new regexp
objintpattern.pattern = "^(http://|https://){0,1}[a-za-z0-9][a-za-z0-9-.]+[a-za-z0-9].[a-za-z]{2,}[#-~]*$"
objintpattern.global = true
isurl = objintpattern.test(strtmp)
set objintpattern = nothing
z:
end functionprivate sub command1_click()
msgbox isurl( "http://www.sohu.com")
end sub
相关文章
- 《夜族崛起》铁匠西里尔位置一览 05-17
- 《寓言之地》1.02更新内容一览 05-17
- 《辐射4》steam好评率介绍 05-17
- 《夜族崛起》技能强化珠宝掉落说明 05-17
- 《辐射4》主机控制台介绍 05-17
- 《星露谷物语》海草和绿藻获取方法 05-17