ubbcode简单实用(3)


    re.Pattern="(\[color=(.[^\[]*)\])(.[^\[]*)(\[\/color\])"
    strContent=re.Replace(strContent,"<font color=""https://www.jb51.net/article/$2"">$3</font>")
    re.Pattern="(\[face=(.[^\[]*)\])(.[^\[]*)(\[\/face\])"
    strContent=re.Replace(strContent,"<font face=""https://www.jb51.net/article/$2"">$3</font>")
    re.Pattern="(\[align=(.[^\[]*)\])(.*)(\[\/align\])"
    strContent=re.Replace(strContent,"<divhttps://www.jb51.net/article/$2"">$3</div>")

re.Pattern="(\[QUOTE\])(.*)(\[\/QUOTE\])"
    strContent=re.Replace(strContent,"<table cellpadding=""0"" cellspacing=""0""0""94%"" bgcolor=""#D7F0FF""center""><tr><td><table100%"" cellpadding=""5"" cellspacing=""1""0""><TR><TD BGCOLOR='"&abgcolor&"'>$2</table></table><br>")
    re.Pattern="(\[fly\])(.*)(\[\/fly\])"
    strContent=re.Replace(strContent,"<marquee90%"" behavior=""alternate"" scrollamount=""3"">$2</marquee>")
    re.Pattern="(\[move\])(.*)(\[\/move\])"
    strContent=re.Replace(strContent,"<MARQUEE scrollamount=""3"">$2</marquee>") 
    re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/GLOW]"
    strContent=re.Replace(strContent,"<tablehttps://www.jb51.net/article/$1""filter:glow(color=https://www.jb51.net/article/$2, strength=https://www.jb51.net/article/$3)"">$4</table>")
    re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/SHADOW]"
 strContent=re.Replace(strContent,"<table width=https://www.jb51.net/article/$1filter:shadow(color=https://www.jb51.net/article/$2, strength=https://www.jb51.net/article/$3)"">$4</table>")

re.Pattern="(\[i\])(.[^\[]*)(\[\/i\])"
    strContent=re.Replace(strContent,"<i>$2</i>")
    re.Pattern="(\[u\])(.[^\[]*)(\[\/u\])"
    strContent=re.Replace(strContent,"<u>$2</u>")
    re.Pattern="(\[b\])(.[^\[]*)(\[\/b\])"
    strContent=re.Replace(strContent,"<b>$2</b>")
    re.Pattern="(\[fly\])(.[^\[]*)(\[\/fly\])"
    strContent=re.Replace(strContent,"<marquee>$2</marquee>")

re.Pattern="(\[size=1\])(.[^\[]*)(\[\/size\])"
    strContent=re.Replace(strContent,"<font size=""1"">$2</font>")
    re.Pattern="(\[size=2\])(.[^\[]*)(\[\/size\])"
    strContent=re.Replace(strContent,"<font size=""2"">$2</font>")
    re.Pattern="(\[size=3\])(.[^\[]*)(\[\/size\])"
    strContent=re.Replace(strContent,"<font size=""3"">$2</font>")
    re.Pattern="(\[size=4\])(.[^\[]*)(\[\/size\])"
    strContent=re.Replace(strContent,"<font size=""4"">$2</font>")
    re.Pattern="(\[center\])(.[^\[]*)(\[\/center\])"
    strContent=re.Replace(strContent,"<center>$2</center>")
    '以下扩展
    re.Pattern="(\[li\])(.[^\[]*)(\[\/li\])"
    strContent=re.Replace(strContent,"<li>$2</li>")
    '字体背景
    re.Pattern="(\[fontbg=(.[^\[]*)\])(.[^\[]*)(\[\/fontbg\])"
    strContent=re.Replace(strContent,"<span style=background-color:""https://www.jb51.net/article/$2"">$3</span>")
    '删除线
    re.Pattern="(\[strike\])(.[^\[]*)(\[\/strike\])"
    strContent=re.Replace(strContent,"<strike>$2</strike>")

re.Pattern="(\[HTML\])(.[^\[]*)(\[\/HTML\])"
 strContent=re.Replace(strContent,"<table cellspacing='0' cellpadding='6' bgcolor='"&abgcolor&"'><td><b>以下内容为程序代码:</b><br>$2</td></table>")
 re.Pattern="(\[code\])(.[^\[]*)(\[\/code\])"
 strContent=re.Replace(strContent,"<table cellspacing='0' cellpadding='6' bgcolor='"&abgcolor&"'><td><b>以下内容为程序代码:</b><br>$2</td></table>")


    strContent=ChkBadWords(strContent)

set re=Nothing
    UBBCode=strContent
end function
%>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wfzwpz.html