日期:2014-05-17  浏览次数:20816 次

取字段中的指定内容
取字段中的指定内容
字段中有内容如下:
<img   height= "75 "   src= "/tools/loadimg.asp?FileName=200779154654641.gif "   width= "250 "   border= "0 "   />
<img   height= "75 "   src= "/tools/loadimg.asp?FileName=200779154654642.gif "   width= "250 "   border= "0 "   />
<img   height= "75 "   src= "/tools/loadimg.asp?FileName=200779154654643.gif "   width= "250 "   border= "0 "   />

我想取出其中三个图片文件的文件名,
200779154654641.gif
200779154654642.gif
200779154654643.gif
怎么取。用ASP的编写。谢谢了。

------解决方案--------------------
<%
dim str
str = " <img height= " "75 " " src= " "/tools/loadimg.asp?FileName=200779154654641.gif " " width= " "250 " " border= " "0 " " /> "
str = str& " <img height= " "75 " " src= " "/tools/loadimg.asp?FileName=200779154654642.gif " " width= " "250 " " border= " "0 " " /> "
str = str& " <img height= " "75 " " src= " "/tools/loadimg.asp?FileName=200779154654643.gif " " width= " "250 " " border= " "0 " " /> "
Dim regEx, Match, Matches ' 建立变量。
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = "FileName=(\d+)\.gif " ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分大小写。
regEx.Global = True ' 设置全局替换。
Set Matches = regEx.Execute(str) ' 执行搜索。
For Each Match in Matches ' 遍历 Matches 集合。
Response.Write(Replace(Match.Value, "FileName= ", " ")& " <br/> ")
Next
%>