Jeg har prøvet at kringle den sammen med denne her kode, hvorfor virker det nu ikke? Det er også en funktion og der bliver strText også defineret.
<%
Function replaceFunction(strText)
Set objRegExp = New regexp
objRegExp.Global = true
objRegExp.IgnoreCase = true
objRegExp.Pattern = "(http://(\w|\.|/|-|\?|=|&|;|~){1,}\w*)"
strText = objRegExp.Replace(strText,"<b><a href='$1' target='_blank'>$1</a></b>")
objRegExp.Pattern = "(www(\w|\.|/|-|\?|=|&|;|~){1,}\w*)"
strText = objRegExp.Replace(strText,"<b><a href='
http://$1' target='_blank'>$1</a></b>")
strText = Replace(strText,":-)","<img height='15' width='15' src='/Pictures/Smileys/smiley.gif'>")
strText = Replace(strText,":)","<img height='15' width='15' src='/Pictures/Smileys/smiley.gif'>")
strText = Replace(strText,":D","<img height='15' width='15' src='/Pictures/Smileys/bigSmiley.gif'>")
strText = Replace(strText,":-D","<img height='15' width='15' src='/Pictures/Smileys/bigSmiley.gif'>")
strText = Replace(strText,";-)","<img height='15' width='15' src='/Pictures/Smileys/blinkSmiley.gif'>")
strText = Replace(strText,";)","<img height='15' width='15' src='/Pictures/Smileys/blinkSmiley.gif'>")
strText = Replace(strText,":-P","<img height='15' width='15' src='/Pictures/Smileys/tongue.gif'>")
strText = Replace(strText,":P","<img height='15' width='15' src='/Pictures/Smileys/tongue.gif'>")
strText = Replace(strText,":-p","<img height='15' width='15' src='/Pictures/Smileys/tongue.gif'>")
strText = Replace(strText,":p","<img height='15' width='15' src='/Pictures/Smileys/tongue.gif'>")
strText = Replace(strText,":-(","<img height='15' width='15' src='/Pictures/Smileys/cry.gif'>")
strText = Replace(strText,":(","<img height='15' width='15' src='/Pictures/Smileys/cry.gif'>")
strText = Replace(strText,":-O","<img height='15' width='15' src='/Pictures/Smileys/chok.gif'>")
strText = Replace(strText,":O","<img height='15' width='15' src='/Pictures/Smileys/chok.gif'>")
strText = Replace(strText,":-o","<img height='15' width='15' src='/Pictures/Smileys/chok.gif'>")
strText = Replace(strText,":o","<img height='15' width='15' src='/Pictures/Smileys/chok.gif'>")
if lcase(left(strText,3)) = "<p>" then
strText = right(strText, len(strText-3))
end if
if lcase(right(strText,4)) = "</p>" then
strText = left(strText, len(strText-4))
end if
strText = replace(strText, "<p>", "<br><br>", 1, -1, vbTextCompare)
strText = replace(strText, "</p>", "", 1, -1, vbTextCompare)
replaceFunction = strText
End Function
%>