自己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标签
%>