function c(tstr,word)
dim re
set re = new regexp
re.ignorecase =true
re.global=true
re.pattern = "("&word&")"
c=re.replace(tstr,"<font style='color:red;'>$1</font>")
end function
调用方法
response.write c("内容字串","要显示为红色的字")
比如
<%
function c(tstr,word)
dim re
set re = new regexp
re.ignorecase =true
re.global=true
re.pattern = "("&word&")"
c=re.replace(tstr,"<font style='color:red;'>$1</font>")
end function
response.write("lamking.com","a")
%>
就把lamking.com中的a替换为红色的。