复制代码 代码如下:
<%
FunctionSenFe_UbbCode(sContent)
DimTempReg
SetTempReg=NewRegExp
WithTempReg
.IgnoreCase=True
.Global=True
'自动识别网址
IfInStr(Lcase(sContent),"http://")>0Then
.Pattern="(^|[^<=""])(http:(//|)(([w/+-~`@:%])+.)+([w/.=?+-~`@':!%#]|(&)|&)+)"
sContent=.Replace(sContent,"$1
EndIf
'自动识别www等开头的网址
IfInStr(Lcase(sContent),"www.")>0orInStr(Lcase(sContent),"bbs.")>0Then
.Pattern="(^|[^/w=])((www|bbs).(w)+.([w/.=?+-~`@'!%#]|(&))+)"
sContent=.Replace(sContent,"$1
EndIf
EndWith
SetTempReg=Nothing
SenFe_UbbCode=sContent
EndFunction
%>
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]