利用ASP正则提取文章里面的图片的有效的src地址
<%
Function gameimgs(content)
Set regEx = New RegExp '建立正则表达式。
regEx.Pattern = "(<img)(.[^<>]*)(src=)('|"&CHR(34)&"| )?(.[^'|\s|"&CHR(34)&"]*)(\.)(jpg|gif|png|bmp|jpeg)('|"&CHR(34)&"|\s|>)(.[^>]*)(>)" '设置模式。
regEx.IgnoreCase = True '设置是否区分字符大小写。
regEx.Global = True '设置全局可用性。
Set Matches = regEx.Execute(content) '执行搜索。
For Each Match in Matches '遍历匹配集合。
'输入图片地址
'Response.Write Match.SubMatches(4)&"."&Match.SubMatches(6)
gameimgs = Match.SubMatches(4)&"."&Match.SubMatches(6)
Next
End Function
%>
<ol>
<%
set imgrs=server.CreateObject("adodb.recordset")
imgrs.open "select * from news",conn,1,3
if imgrs.eof and imgrs.bof then
response.write "111"
else
do until imgrs.eof
response.write "<li>"& imgrs("title")
imgrs("saveimg") = gameimgs(imgrs("game"))
imgrs("img") = gameimgs(imgrs("game"))
response.write "</li>"
imgrs.update
imgrs.movenext
loop
end if
imgrs.close
set imgrs=nothing
%>
</ol>
<%conn.close:set conn=nothing%>
利用ASP正则提取文章里面的图片的有效的src地址的示例
- 相关阅读
- 金岸国际旅行社
- 武义熟溪温泉旅行网
- 初学ASP动态网页制作常用错误处理
- 绝对管用的Swishmax (Flash制作) 绿色特别版下载
- ASP链接地址栏参数的加密
- CSS Alpha透明代码相关知识学习
- 获取客户真实IP地址
- 连云港汽车门户网站
- 共有0条关于《利用ASP正则提取文章里面的图片的有效的src地址》的评论
- 发表评论
您发布的评论即表示同意遵守以下条款:
一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家、社会、集体和公民的合法权益;
二、不得发布国家法律、法规明令禁止的内容;互相尊重,对自己在本站的言论和行为负责;
三、本站对您所发布内容拥有处置权。
- 更多>>同类信息
- ASP中Utf-8与Gb2312编码转换乱码问题的解决方法页面编码声明
- asp显示随机密码
- 通过阿里云服务接口获得ip地址详细信息
- iis点开后任务栏上有显示,但是窗口看不到的解决办法
- RSA加密解密插件
- 微软Encoder加密解密函数