QUOTE:
标题: VBScript 函数 之 标签链接
作用: 以逗号(,)分界标签, 完美实现.
shawl.qiu
2006-7-2
作用: 以逗号(,)分界标签, 完美实现.
shawl.qiu
2006-7-2
- linenum
- '标签连接函数
- 'sample call '''// ftaglink(tag_) //'''
- function ftaglink(tag)
- if isNull(tag) then exit function
- if instr(tag,",")=0 then
- tag="<a href=""tag.asp?id=tag&tag="&tag&"#anchor"">"&tag&"</a>"
- else
- set re=new regExp
- re.global=true
- re.ignoreCase=true
- re.pattern="(.*?),"
- tag=re.replace(tag,"<a href=""tag.asp?id=tag&tag=$1#anchor"">$1</a>,")
- re.pattern="(.*,)(.*)"
- tag=re.replace(tag,"$1<a href=""tag.asp?id=tag&tag=$2#anchor"">$2</a>")
- set re=nothing
- end if
- response.write tag
- end function