<% Function getphoto(strHTML) '从html里取得img标签 Dim objRegExp, Match, Matches Set objRegExp = New Regexp objRegExp.IgnoreCase = True objRegExp.Global = True objRegExp.Pattern = "<img.+?>" tp = "" Set Matches = objRegExp.Execute(strHTML) For Each Match in Matches tp = tp & Match.value Exit For Next getphoto = tp Set objRegExp = Nothing End Function %> <html xmlns="http://www.111cn.net/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> </head>
<body> <% Dim str str ="从html里取得img标签 <img src=/get_pic/2010/03/20100519002423914.gif />fdafdafdajk" if str <> "" then response.write getphoto( str ) end if %> </body> </html> |