提取文章中的图片标签!!!

fujunle 2007-04-13 06:09:46
如何提取数据库备注型字段中的<img ... </img>标签,最终得到在网页能够显示!!!
...全文
209 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Atai-Lu 2007-04-14
  • 打赏
  • 举报
回复
Function ReplaceText(fString,patrn,replStr)
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = patrn ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分大小写。
regEx.Global = True ' 设置全局可用性。
ReplaceText = regEx.Replace(""&fString&"",""&replStr&"") ' 作替换。
Set reg=nothing
End Function

str=ReplaceText(str,"\[IMG\]([^"&CHR(34)&"[]*)(\[\/IMG\])","<img border=0 src=$1>")
fujunle 2007-04-14
  • 打赏
  • 举报
回复
木木木木木木木木木木木木木木木木木
"<A href=""http://cimg2.163.com/cnews/2007/4/13/200704131730145d240.jpg"" target=_blank>
<P align=center><IMG alt="""" src=""http://cimg2.163.com/cnews/2007/4/13/200704131730145d240.jpg"" onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333"" border=0></A><BR>木木木木木木木木木木木木木木木木木木木木木木木木木木</P>"

这些内容都在一个字段中,我想的是
<IMG alt="""" src=""http://cimg2.163.com/cnews/2007/4/13/200704131730145d240.jpg"" onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333"" border=0>
fujunle 2007-04-14
  • 打赏
  • 举报
回复
最后STR得出的还是不对
tantaiyizu 2007-04-13
  • 打赏
  • 举报
回复
replace(str , "<img>" ,"<img src=")
replace(str , "</img>" ,">")
nihaopp 2007-04-13
  • 打赏
  • 举报
回复
关注!
fujunle 2007-04-13
  • 打赏
  • 举报
回复
<img标签前后都还有文字

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧