当前位置: 代码迷 >> ASP >> 初学者求解 数据读取筛选
  详细解决方案

初学者求解 数据读取筛选

热度:105   发布时间:2012-08-14 10:39:58.0
菜鸟求解 数据读取筛选
自己D_Content这个字段里面储存了上传图片的路径和文章内容
在前台<%=prs("D_Content")%>读取
会把图片也读出来
我想只读文字
怎么把图片路径那段筛选掉
求大侠指教

最好告诉小弟代码

万分感谢

------解决方案--------------------
VB code
<%
Function Removehtml(Strhtml,reg)
     Dim Objregexp, Match, Matches
     Set Objregexp = New Regexp
     Objregexp.Ignorecase = True
     Objregexp.Global = True
     Objregexp.Pattern = reg
     Set Matches = Objregexp.Execute(Strhtml)
     For Each Match In Matches
     Strhtml=Replace(Strhtml,Match.Value,"")
     Next
     Removehtml=Strhtml
     Set Objregexp = Nothing
End Function

dim str
str="<IMG src=""../UploadFile/200541821112564.gif"" border=0>测试一<br/>下效<p>果</p>!"
Response.write Removehtml(str,"<img.+?>")
Response.write Removehtml(str,"<.+?>") '过滤所有html标签
%> 
  相关解决方案