[导入]ASP常用函数:FixImg()

<%
'功能:请<img>标签格式化为<img src="http://www.reallydo.com/images/logo_88x31.gif" />模式
'来源:http://jorkin.reallydo.com/article.asp?id=480
'需要RegReplace函数:http://jorkin.reallydo.com/article.asp?id=345

Function FixImg(sString)
    
FixImg = sString & ""
    
FixImg = RegReplace(FixImg, "\s[on].+?=([\""|\'])(.*?)\1", "")
    
FixImg = RegReplace(FixImg, "<img.*?\ssrc=([^\""\'\s][^\""\'\s>]*).*?>", "<img src=""$1"" />")
    
FixImg = RegReplace(FixImg, "<img.*?\ssrc=([\""\'])([^\""\']+?)\1.*?>", "<img src=""$2"" />")
End Function
%>

 


文章来源:http://Jorkin.Reallydo.Com/default.asp?id=480
posted @ 2008-03-09 16:32  pboy2925  阅读(102)  评论(0)    收藏  举报