asp从编辑中过滤和显示图片分别怎么写

aa88450088 2012-07-14 10:15:53
asp从编辑中过滤和显示图片分别怎么写,请高人请教下。(通过后编辑器加的文章,中间带有图,想单独显示文字或图)
...全文
87 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
content=rs("content")'数据库的内容字段
Set re = New RegExp
re.Pattern = "<img(.+?)src=""*([^\s]+?)""*(\s|>)"
re.Global = True
re.IgnoreCase = True
Set Contents = re.Execute(content)
For Each Match in Contents ' 遍历匹配集合。
Response.Write "<img src='"&Images & Match.SubMatches(1)&"' />"
Next
content=re.replace(content, "") '把图片过滤掉,剩下的就是文字了,上面那个匹配的就都是图片了,自己可以运行测试就输出结果看下就明白了

宇凡网络 2012-07-16
  • 打赏
  • 举报
回复
这个是用正则把图片摘出来,其余的就是内容了


content=rs("content")'数据库的内容字段
Set re = New RegExp
re.Pattern = "<img(.+?)src=""*([^\s]+?)""*(\s|>)"
re.Global = True
re.IgnoreCase = True
Set Contents = re.Execute(content)
For Each Match in Contents ' 遍历匹配集合。
Response.Write "<img src='"&Images & Match.SubMatches(1)&"' />"
Next




孟子E章 2012-07-15
  • 打赏
  • 举报
回复
正则表达式分解成图片进行显示吧
auisoft 2012-07-15
  • 打赏
  • 举报
回复
意思没表达清楚,无法解答

28,391

社区成员

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

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