1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <% Set conn=server.CreateObject("adodb.connection") conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("/test/data.mdb") Set rs=server.CreateObject("adodb.recordset") sqlstr="select * from wenzhang" rs.open sqlstr,conn,1,1 %> <body> <% dim src content=rs("neirong") Str = Content Set regEx = New RegExp regEx.Pattern = "(<img)(.[^<>]*)(src=)('|"&CHR(34)&"| )?(.[^'|\s|"&CHR(34)&"]*)(\.)(jpg|gif|png|bmp|jpeg)('|"&CHR(34)&"|\s|>)(.[^>]*)(>)" regEx.IgnoreCase = True regEx.Global = True Set Matches = regEx.Execute(Str)
For Each Match in Matches
Response.Write "<img src='"&Match.SubMatches(4)&"."&Match.SubMatches(6)&"'>" Response.Write Match.SubMatches(4)&"."&Match.SubMatches(6)&"<br>" Next
Set Match=Matches(0) Response.Write "<img src='"&Match.SubMatches(4)&"."&Match.SubMatches(6)&"'>" %>
|