求一个输出字段问题

来源:百度知道 编辑:UC知道 时间:2024/07/04 19:20:11
输出字段名为link,也就是正常取值是<%= Rs("link") %>,现在我用函数取整,如下:
<%
strs="?????"
response.write mystr(strs)'将返回"href="后面的字符.更改re.Pattern的值,可以得到任意想要的部分.具体规则请参读正则相关知识.

function mystr(byval str)
Set re=new RegExp
re.IgnoreCase =true
re.Global=false
re.Pattern="href=(.*)"
set Matches=re.execute(str)
For Each strMatch in Matches
strs=strMatch.SubMatches(0)
Next
mystr=strs
set re = nothing
end function
%>
求其中?????部份应该如何写,能输出link值?
我用这样写法出错,望高手留下个QQ,谢谢
<%
strs=Rs("link")
response.write mystr(strs)'将返回"href="后面的字符.更改re.Pattern的值,可以得到任意想要的部分.具体规则请参读正则相关知识.

function mystr(byval str)
Set re=new RegExp
re.IgnoreCase =true
re.Global=false
re.Pattern="href=(.*)"
set Matches=re.execute(str)
For Each strMatch in Matches
strs=strMatch.SubMatches(0) <

<%= Rs("link") %>等价于Rsponse.write Rs("link") 就是向客户区域输出link字段。
那如果是给变量赋值就直接是
strs=Rs("link")

报了什么错呢?贴上来看看。