När jag testar det så får jag bara:
Microsoft VBScript runtime error '800a1399'
Syntax error in regular expression
includes/codes.asp, line 38
Fast jag har redan en del kod där också, så kanske är den som strular lite? Jag är så dålig på RegExp ännu :)
<%
Function FixLinks(ByVal strText)
With New RegExp
.Global=True
.IgnoreCase=True
.Pattern="(http://)([\w~%&=#:\-/\?\.]*[\w~%&=#:\-/])"
strText=.Replace(strText,"<a href=""$1$2"" target=""_blank"">$2</a>")
strText = Replace(strText,":)","<img src=""community/Includes/smileys/glad.gif"">")
strText = Replace(strText,"><","<img src=""community/Includes/smileys/ahh.gif"">")
strText = Replace(strText,":P","<img src=""community/Includes/smileys/P.gif"">")
strText = Replace(strText,":(","<img src=""community/Includes/smileys/sur.gif"">")
strText = Replace(strText,":-(","<img src=""community/Includes/smileys/grater.gif"">")
strText = Replace(strText,";)","<img src=""community/Includes/smileys/blink.gif"">")
strText = Replace(strText,":D","<img src=""community/Includes/smileys/superglad.gif"">")
strText = Replace(strText,":0","<img src=""community/Includes/smileys/smiley3.gif"">")
strText = Replace(strText,":S","<img src=""community/Includes/smileys/smiley5.gif"">")
strText = Replace(strText,":@","<img src=""community/Includes/smileys/smiley7.gif"">")
strText = Replace(strText,vbcrlf,"<br>")
strText = Replace(strText, "[b]", "<b>")
strText = Replace(strText, "[/b]", "</b>")
strText = Replace(strText, "[c]", "<center>")
strText = Replace(strText, "[/c]", "</center>")
strText = Replace(strText, "[u]", "<u>")
strText = Replace(strText, "[/u]", "</u>")
strText = Replace(strText, "[i]", "<i>")
strText = Replace(strText, "[/i]", "</i>")
strText = Replace(strText, "[red]", "<font color=""#ff0000"">")
strText = Replace(strText, "[/red]", "</font>")
strText = Replace(strText, "[p]", "<p></p>")
strText = Replace(strText, "[br]", "<br />")
strText = Replace(strText, "<embed>", "****")
strText = Replace(strText, "<script>", "****Jag är en dålig hacker****")
set re = new regexp
re.global = true
re.pattern = "[img=([^]]+)]"
strText = re.replace(strText, "<img src=""$1"" />")
End With
FixLinks=strText
End Function
Function Kort(strText,intNumb)
If Len(strText) > intNumb Then
Response.Write Left(strText,intNumb)&"..."
Else
Response.Write strText
End If
End Function
%>