Function LinkString2(strInput)
Set objRegExpHTTP1 = New RegExp
Set objRegExpHTTP2 = New RegExp
objRegExpHTTP1.Pattern = "(http|ftp)(:\/\/[\w\._-]+\.[\w\._-]+\S*)"
objRegExpHTTP2.Pattern = "(^|[^\/])(www[^\.\s]?\.[\w\._-]+\.[A-Za-z]{2,3}[\w\S]*)"
objRegExpHTTP1.Global = True
objRegExpHTTP2.Global = True
objRegExpHTTP1.IgnoreCase = True
objRegExpHTTP2.IgnoreCase = True
strOutput = objRegExpHTTP1.Replace(strInput, " <a href='$1$2' target='_blank'>$1$2</a> ")
strOutput = objRegExpHTTP2.Replace(strOutput, " $1<a href='
http://$2' target='_blank'>$2</a> ")
objRegExpHTTP2.Pattern = "(<br>|[,.)\]\}])('>)"
strOutput = objRegExpHTTP2.Replace(strOutput, "$2")
objRegExpHTTP2.Pattern = "(<br>|[,.)\]\}])(' target=)"
strOutput = objRegExpHTTP2.Replace(strOutput, "$2")
objRegExpHTTP2.Pattern = "(<br>|[,.)\]\}])(</a>)"
strOutput = objRegExpHTTP2.Replace(strOutput, "$2$1")
Set objRegExpHTTP2 = Nothing
set objRegExpHTTP1 = Nothing
LinkString2 = strOutput
End Function
Og den kaldes sådan her:
response.write linkString2 rs("kolonne_med_beskeden")
//>Rune