这串ASP代码是什么意思

来源:百度知道 编辑:UC知道 时间:2024/05/17 08:25:38
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True

'strcontent=Replace(strcontent,"file:","file :")
'strcontent=Replace(strcontent,"files:","files :")
'strcontent=Replace(strcontent,"script:","script :")
'strcontent=Replace(strcontent,"js:","js :")

'图片UBB
re.pattern="\[img\](http|https|ftp):\/\/(.[^\[]*)\[\/img\]"
strcontent=re.replace(strcontent,"<a onfocus=""this.blur()"" href=""$1://$2"" target=new><img src=""$1://$2"" border=""0"" alt=""按此在新窗口浏览图片"" onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333""></a>")
'链接UBB
re.pattern="(\[url\])(.[^\[]*)(&#

dim re
Set re=new RegExp 呵呵,很熟悉的正则表达式替换。后面有Replace(strcontent,"file:","file :") 函数。

其实就是论坛的UBB功能,将普通网页中的HTML代码做个替换。像第二个论坛插入连接功能的替换,普通HTML是用<a></a>标签,但UBB替换成[url][/url]
第一个是论坛的插入图片功能,替换成[img]