28,391
社区成员
发帖
与我相关
我的任务
分享
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, "") '把图片过滤掉,剩下的就是文字了,上面那个匹配的就都是图片了,自己可以运行测试就输出结果看下就明白了
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