Function GetImg(str) dim objregEx,zzstr,matches,Match,retstr,Imglist,Imgone,strpath set objregEx = new RegExp objregEx.IgnoreCase = true objregEx.Global = true zzstr="<img(.+?)\.(jpg|gif|png|bmp)(.+?)>" objregEx.Pattern = zzstr set matches = objregEx.execute(str) for each match in matches retstr = retstr &"|"& Match.Value next if retstr<>"" then Imglist=split(retstr,"|") Imgone=replace(Imglist(1),strpath,"") GetImg=Imgone else GetImg="" end if end function
调用的时候 只需要 <%=GetImg(rs("字段"))%> |