<%
Function LinkString2(strInput)
Set objRegExpHTTP1 = New RegExp
Set objRegExpHTTP2 = New RegExp
Set objRegExpEMail = New RegExp
objRegExpHTTP1.Pattern = "(http|ftp|https)(:\/\/[\w]+)(.[\w]+)([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?"
objRegExpHTTP2.Pattern = "(^|[^\/])(www)(.[\w]+)([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?"
objRegExpEMail.Pattern = "([\w\._-]+@[\w\._-]+\.[A-Za-z]{2,3}\S*)"
objRegExpHTTP1.Global = True
objRegExpHTTP2.Global = True
objRegExpEMail.Global = True
objRegExpHTTP1.IgnoreCase = True
objRegExpHTTP2.IgnoreCase = True
objRegExpEMail.IgnoreCase = True
strOutput = objRegExpHTTP1.Replace(strInput, "<a href='$1$2$3$4' target='_blank'>$1$2$3$4</a>")
strOutput = objRegExpHTTP2.Replace(strOutput, " $1<a href='
http://$2$3$4' target='_blank'>$2$3$4</a>")
strOutput = objRegExpEMail.Replace(strOutput, " <a href='mailto:$1'>$1</a> ")
Set objRegExpHTTP2 = Nothing
set objRegExpHTTP1 = Nothing
Set objRegExpEMail = Nothing
LinkString2 = strOutput
End Function
str = "En streng som indeholder et link fx.
www.google.dk"response.write linkString2 (Trim(str)) ' Trim fjerner mellemrum foran og efter 'str'
%>