CSDN博客

img asthlon

BBS里UBB的全码

发表于2004/10/25 11:29:00  681人阅读

BBS里UBB的全码
<%
function out(str)
out=Server.HTMLEncode(str)
out=replace(out,vbcrlf,"<br>")
out=ubbcode(out,"/[img/](.*?)/[//img/]","<img src=""$1"" border=""0"">")
out=ubbcode(out,"/[img align=left/](.*?)/[//img/]","<img src=""$1"" align=""left"" border=""0"">")
out=ubbcode(out,"/[img align=right/](.*?)/[//img/]","<img src=""$1"" align=""right"" border=""0"">")
out=ubbcode(out,"/[img align=center/](.*?)/[//img/]","<div align=""center""><img src=""$1"" border=""0""></div>")
out=ubbcode(out,"/(.*?)/[//color/]","<font color=""$1"">$2</font>")
out=ubbcode(out,"/[url=(.*?)/](.*?)/[//url/]","<a href=""$1"" target=""_blank"">$2</a>")
out=ubbcode(out,"/[url/](.*?)/[//url/]","<a href=""$1"" target=""_blank"">$1</a>")
out=ubbcode(out,"/[center/](.*?)/[//center/]","<center>$1</center>")
out=ubbcode(out,"/[b/](.*?)/[//b/]","<b>$1</b>")
out=ubbcode(out,"/[i/](.*?)/[//i/]","<i>$1</i>")
out=ubbcode(out,"/[u/](.*?)/[//u/]","<u>$1</u>")
out=ubbcode(out,"/[h1/](.*?)/[//h1/]","<h1>$1</h1>")
out=ubbcode(out,"/[h2/](.*?)/[//h2/]","<h2>$1</h2>")
out=ubbcode(out,"/[h3/](.*?)/[//h3/]","<h3>$1</h3>")
out=HTMLcode(out)
end function
%>

<%
function HTMLcode(str)
Set re=new RegExp
re.IgnoreCase=True
re.Global=True
re.Pattern="(?:^|>)(?:.*?)(?:<|$)"
Set Searchs=re.Execute(str)
For Each Search In Searchs
s=replace(Search.value," ","&nbsp;")
str=replace(str,Search.value,s)
Next
HTMLcode=str
End Function
%>

<%
function ubbcode(str1,str2,str3)
Set re = new RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = str2
ubbcode = re.replace(str1,str3)
end function
%>

阅读全文
0 0

相关文章推荐

  • bbs2000燕衔泥UBB论坛.zip
    france_french 2012-01-11 13:26 1
  • 全码输入法
    pangu 2006-03-16 00:00 7
  • 全码输入法
    pangu 2006-03-16 00:00 10
  • javaLiu全码
    qingtian813 2012-03-18 11:05 0
  • C#绘制条码CODE39和CODE39全码模式
    brian0031 2013-02-01 14:37 530
  • FD全码全能版3.0
    hhdhcg 2014-08-14 16:16 0
  • C# 获取汉语拼音全码及简码
    kingboy2008 2011-08-02 09:38 2774
  • 全码 WDB 论坛
    chenxh 2005-12-27 09:38 17
img
取 消
img