ASP怎样获得代码中第一张图片地址

'参数:

'code:要检测的代码

'leixing:html或者ubb

'nopic:代码没有图片认值

function toppic(code,leixing,nopic)

        set regex = new regexp

        regex.ignorecase = true

        regex.global = true

        if leixing = "html" then

                regex.pattern = "<img(.*?)srcs?=s?(u0022?)([^u0022/>]+)"

        else

                regex.pattern = "[img]([^u005B]+)“

        end if

        set matches = regex.execute(code)

        if regex.test(code) then

                                  if leixing = "html" then

                           toppic = matches(0).submatches(3)

                                  else

                                           toppic = matches(0).submatches(0)

                                  end if

        else

                toppic = nopic

        end if

end function

code1 = "<img src=""1.gif"">"

pic = toppic(code1,"html","nopic.gif")

response.Write pic

相关文章

数组的定义 Dim MyArray MyArray = Array(1‚5‚123‚12‚98...
\'参数: \'code:要检测的代码 \'leixing:html或者ubb \'n...
演示效果: 代码下载: 点击下载
环境:winxp sp2 ,mysql5.0.18,mysql odbc 3.51 driver 表采...
其实说起AJAX的初级应用是非常简单的,通俗的说就是客户端(j...
<% ’判断文件名是否合法 Function isFilename(aFilename...