<%Function FixaLankar(s)
On error resume next
Set objRE = new RegExp
objRE.IgnoreCase = True : objRE.Global = True
objRE.Pattern = "(http:\/\/|www\.)(\w|\&|\:|\;|\.|\/|\?|\~|\=|-)+"
Set m = objRE.Execute(s)
For Each o In m
If Right(o.Value, 1)="." Or Right(o.Value, 1)="!" Or Right(o.Value, 1)="?" Or Right(o.Value, 1)="," Then
If Left(o.Value, 3) = "www" Then s = Replace(s, o.Value, "<A HREF=""http://" & Left(o.Value, Len(o.Value)-1) & """ target=""_blank"">" & Left(o.Value, Len(o.Value)-1) & "</A>" & Right(o.Value, 1)) Else s = Replace(s, o.Value, "<A HREF=""" & Left(o.Value, Len(o.Value)-1) & """>" & Left(o.Value, Len(o.Value)-1) & "</A>" & Right(o.Value, 1))
Else
If Left(o.Value, 3) = "www" Then s = Replace(s, o.Value, "<A HREF=""http://" & o.Value & """ target=""_blank"">" & o.Value & "</A>") Else s = Replace(s, o.Value, "<A HREF=""" & o.Value & """ target=""_blank"">" & o.Value & "</A>")
End If
Next
Set objRE = Nothing
strText = RecSet("inlagg")
strText = Server.HTMLEncode(strText)
Set objRegExp = New regexp
objRegExp.Global = true
objRegExp.IgnoreCase = true
objRegExp.Pattern = "<"
strText = objRegExp.Replace(strText,"<font color=""#ff0000""><")
objRegExp.Pattern = ">"
strText = objRegExp.Replace(strText,"></font>")
' Tillåten HTML kod
s = Replace(s,"[f]","<b>")
s = Replace(s,"[/f]","</b>")
s = Replace(s,"[k]","<i>")
s = Replace(s,"[/k]","</i>")
s = Replace(s,"[KOD]","<font color=#FF0000>")
s = Replace(s,"
","</font>")
s = Replace(s,"<%","<%")
s = Replace(s,"%>","%>")
s = Replace(s, vbCrLf, "<br>")
s = Replace(s,"","")
FixaLankar = s
End Function%>