复制代码代码如下:
%dim参数,微笑参数是UBB标签完全可用的标记参数=满则完全可用,否则不支持一些占位大的标签笑容是禁止笑脸转换函数UBBCode(content)dim n,I on error resume next set re=new regexpre .IgnoreCase=truere.global=true
re.pattern=[code](rn)?([sS)?)[/code]设置匹配=回复.执行(内容)dim code()n=0 if re。test(content)then codeb=true如果codeb then For Matches中的每个匹配redim保留代码(n)代码(n)=匹配.值对于i=0,n=n 1 Nextfor到如果代码(i)=,则为ubound(代码)然后exit forcontent=replace(content,code(i), {codei})nextend if
如果param= full ,则re。pattern= [html ]( r n)?([sS)?)[/html]Set Matches=re .execute(content)dim html()n=0 if re。test(content)then html b=true如果html b then For Matches中的每个匹配redim Preserve html(n)html(n)=Match .对于i=0,Valuen=n 1 Nextfor到如果html(i)= 则为ubound(html)然后exit forcontent=replace(content,html(i), { html I } )next end ifend if content=GMT(content) ubb
if codeb then for I=0 to ubound(code)if code(I)=" "然后退出代码=服务器。html encode(code(I))content=replace(content, {codei} ,tcode)nextend if -处理[代码]中的[html]re。pattern= [html ]( r n)?([sS)?)[/html]Set Matches=re .执行(内容)执行搜索。如果re,dim html 2()n=0。test(content)then html 2b=true if html 2b then For Matches 迭代匹配集合中的每个匹配项100 . redim保留html 2(n)html 2(n)=1匹配对于i=0,Valuen=n 1 Nextfor到ubound(html2)if html2(i)=",然后exit forcontent=replace(content,html2(i), {html2i})nextend if
if param= full then if html b then for I=0 to ubound(html)if html(I)= then exit for html=server。html encode(html(I))content=replace(content, {htmli} ,thtml)nextend ifend if
关于. Pattern=([code])(rn)?([sS)?)([/code])content=re .替换(内容, PRE class=CodeSamp$3/PRE )
如果param=已满,则返回. Pattern=([html])(rn)?([sS)?)([/html])content=re .Replace(content, span textarea cols=95 rows=12 $ 3/textareabinput onclick=runCode()type=button value=运行代码nbspinput onclick=复制代码()类型=按钮值=复制代码[Ctrl A全部选择提示:你可先修改部分代码,再按运行]/span )结束如果
if html 2b then for I=0 to ubound(html 2)if html 2(I)=" " then exit for html 2=html 2(I)content=replace(content, {html2i} ,thtml2)nextend if
UBBCode=contentend函数
格林威治标准时间函数(字符串内容)
字符串内容=html过滤器(字符串内容)
dim reSet re=新的正则表达式.IgnoreCase=truere .全局=真
如果param=已满那么如果没有微笑,那么笑脸转换
关于Pattern=([em(d{1,2})])strContent=re .替换(strContent, img src=images/em $ 2。gif border=0 align=middle’)
关于Pattern=:)strContent=re .Replace(strContent, img src=images/smile。gif border=0 align=middle ) re .Pattern=:(strContent=re .Replace(strContent, img src=images/皱眉。gif border=0 align=middle)re .Pattern=:ostrContent=re .替换(strContent, img src=images/red face。gif border=0 align=middle ) re .模式=:DstrContent=re .Replace(strContent, img src=images/big grin。gif border=0 align=middle ) re .模式=;)strContent=re .Replace(strContent, img src=images/wink。gif border=0 align=middle ) re .Pattern=:pstrContent=re .替换(strContent, img src=images/tongue。gif border=0 align=middle ) re .pattern=:cool: str content=re .替换(strContent, img src=images/cool。gif border=0 align=middle ) re .pattern=:roll eyes: str content=re .替换(strContent, img src=images/roll eyes。gif border=0 align=middle ) re .pattern=:mad: str content=re .替换(strContent, img src=images/mad。gif border=0 align=middle ) re .pattern=:eek:""str content=re .替换(strContent, img src=images/eek。gif border=0 align=middle ) re .模式=:困惑: strContent=re .Replace(strContent, img src=images/confused。gif border=0 align=middle ) re .pattern=:cry: str content=re .Replace(strContent, img src=images/cry。gif border=0 align=middle’)
如果…就会结束
关于Pattern=([ATTACHMENT=(.*?)])(.*?)([/ATTACHMENT ]) str content=re .Replace(strContent, pimg src=images/attachment。gif nbsp .a href= $ 2 TARGET=_ blank title= 提示: chr(13)您可以单击右键另存为把该文件下载到本地机器$ 3/AP’)
关于Pattern=([URL])(.*?)([/URL])strContent=re .替换(strContent, A HREF= $ 2 TARGET=_ blank $ 2/A )回复.pattern=([URL=(http | https | FTP | RTSP | MMS)(://)(.*?)])(.*?)([/URL])strContent=re .替换(strContent, A HREF= $ 2 $ 3 $ 4 TARGET=_ blank $ 5/A )
关于Pattern=([EMAIL])(.*?)([/EMAIL])strContent=re .替换(strContent, A HREF= mailto:$ 2 $ 2/A )回复.Pattern=([EMAIL=(.*?)])(.*?)([/EMAIL])strContent=re .替换(strContent, A HREF= mailto:$ 2 TARGET=_ blank $ 3/A )
关于。模式=(^|s|br|p)(http|https|ftp|rtsp|mms)(://)(s)字符串内容=re .替换(strContent, $ 1a target=_ blank href=$ 2 $ 3 $ 4 $ 4/a )回复.模式=(^|s|br|p)(www.)( S)str content=re .替换(strContent, $ 1a target=_ blank href=http://$ 2 $ 3 $ 2 $ 3/a )
文本效果关于Pattern=([list])(.)([/list])strContent=re .替换(strContent,《UL类型=平方两美元/UL).Pattern=([list=)(A|1)(])(.)([/list])strContent=re .替换(strContent, OL TYPE=$2$4/OL )回复.pattern=([ * ]) str content=re .替换(字符串,"李")
关于Pattern=([color=(.*?)])(.*?)([/color])strContent=re .替换(strContent, font color=$2$3/font )回复.Pattern=([#(.{6}?)])(.*?)([/#])strContent=re .替换(strContent, font color=#$2$3/font )回复.Pattern=([font=(.*?)])(.*?)([/font])strContent=re .替换(strContent, font face=$2$3/font )回复.pattern=([align=(left | center | right)]).*?)([/align])strContent=re .替换(strContent, div align=$2$3/div )
关于Pattern=([fly])(.*?)([/fly])strContent=re .Replace(strContent, marquee width=90% 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, table width=$ 1 style= filter:glow(color=$ 2,strength=$3)$4/table)re .Pattern=[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)](.*?)[/SHADOW]strContent=re .Replace(strContent, table width=$ 1 style= filter:shadow(color=$ 2,strength=$3)$4/table )
关于Pattern=([i])(.*?)([/i])strContent=re .替换(字符串, i$2/i )是.Pattern=([u])(.*?)([/u])strContent=re .更换(strContent, u$2/u )回复.Pattern=([b])(.*?)([/b])strContent=re .更换(strContent, b$2/b )回复.Pattern=([sup])(.*?)([/sup])strContent=re .替换(strContent, sup$2/sup)re .Pattern=([sub])(.*?)([/sub])strContent=re .替换(strContent, sub$2/sub )
关于. Pattern=[size=([ |-]?[0-7])](.*?)([/size])strContent=re .替换(strContent, font size=$1$2/font )
关于Pattern=([center])(.*?)([/center])strContent=re .替换(strContent, center$2/center )
设置re=无
gmt=strContentend函数
雷姆过滤超文本标记语言代码函数html过滤器(fString)如果not为null(fString),则fString=server。html encode(fString)fString=Replace(fString,CHR(9), nbsp nbsp nbsp ) Tab fString=Replace(fString,CHR(34), quot) fString=Replace(fString,CHR(39), # 39;) fString=Replace(fString,CHR(13),)回车是一个13 10fString=Replace(fString,CHR(10) CHR(10), P)fString=Replace(fString,CHR(10), BR)fString=Replace(fString,CHR(32), nbsp )空格html filter=fStringend ifend Function % % Function isemail(strng)isemail=false dim regEx,Match Create variables . Set regEx=New RegExp 创建正则表达式对象(蠢吧?)正则表达式.模式=^w ((-w )|(.w ))*@[A-Za-z0-9] (( .|-)[A-Za-z0-9] )*[A-Za-z0-9]设置 pattern.regEx.IgnoreCase=True 设置不区分大小写。设置Match=regEx .执行(strng)执行搜索。如果匹配。计数然后是电子邮件=真正的结束功能%