Copy Code code as follows:
<%
Function Senfe_ubbcode (scontent)
Dim Tempreg
Set Tempreg = New RegExp
With Tempreg
. IgnoreCase = True
. Global = True
' Automatically identify URLs
If InStr (Lcase (scontent), "http://") >0 Then
. Pattern = "(^|[ ^<= ""]) (http: (\/\/|\\\\) ([\w\/\\\+\-~ ' @:%]) +\.) + ([\w\/\\\.\=\?\+\-~ ' @\ ':!%#]| (&) (|&) +) "
Scontent =. Replace (Scontent, "$1<a href=" "$" "target=" "_blank" ">$2</a>")
End If
' Automatic identification of Web sites at the beginning of www
If InStr (Lcase (scontent), "www.") >0 or InStr (Lcase (scontent), "BBS.") >0 Then
. Pattern = "(^|[ ^\/\\\w\=]) ((Www|bbs) \. ( \w) +\. ([\w\/\\\.\=\?\+\-~ ' @\ '!%#]| (&)) +)"
Scontent =. Replace (Scontent, "$1<a href=" "http://$2" "target=" "_blank" ">$2</a>")
End If
End With
Set Tempreg = Nothing
Senfe_ubbcode = Scontent
End Function
%>
<textarea id="runcode53643"><script language= "VBScript" > Function senfe_ubbcode (scontent) Dim tempreg Set tempreg = New RegExp with Temp Reg. IgnoreCase = True. Global = True ' automatically recognizes URL If InStr (Lcase (scontent), "http://") >0 Then. Pattern = "(^|[ ^<= ""]) (http: (\/\/|\\\\) ([\w\/\\\+\-~ ' @:%]) +\.) + ([\w\/\\\.\=\?\+\-~ ' @\ ':!%#]| (&) |&) +) "scontent =. Replace (scontent, "$1$2") End If ' automatically identifies the URL at the beginning of www, if INSTR (Lcase (scontent), "www.") >0 or InStr (Lcase (scontent), "BBS.") >0 Then. Pattern = "(^|[ ^\/\\\w\=]) ((Www|bbs) \. ( \w) +\. ([\w\/\\\.\=\?\+\-~ ' @\ '!%#]| (&)) +) "Scontent =. Replace (scontent, "$1$2") end If End with Set tempreg = no Senfe_ubbcode = Scontent End Function </script> <textarea name= "Scode" cols= "rows=" "></textarea> <input type=" button "value=" Replace "onclick=" Vbscript:document.getElementById (' Scode '). Value=senfe_ubbcode (document.getElementById (' Scode '). Value) "/> </textarea>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]