$1...$9 Properties is supported since version 1.0I am not familiar with UBB, but what cannot you just replace "[" with "<", "]" with ">"?also, you can always do the transformation on the server side

解决方案 »

  1.   

    Thanks  saucer(思归, MS .NET MVP) 哦,现在知道 $1...$9 支持了因为UBB代码不只是[B]-><B>的形式,还有
    ->
    <img src="http://xxx/xx.gif">[size=5]xxx[/size]
    ->
    <font size="5">xxx</font>
    所以只有用正则表达式才能方便的进行转化在server端进行转化是常规做法,不过有些不小心填写不规则的UBB代码会生成不规则的HTML代码,如果把这类转化后的代码嵌入到XML的节点中……可能会导致错误而无法进行解析……如果实在没办法,只好自己编写UBB解析函数来代替正则转化了
    或则用
    re = /\[B\](.[^\[]*)\[\/B\]/gi;
    Str = Str.replace(re,"<B>$1</B>");
    这类写法……
      

  2.   

    it may be an overkill, but UBB looks like XML, replace "[" with "<" and "]" with ">", then use XSL to transform XML into HTMLalso, here is some script in VBScript which seems to convert UBB into HTML:
    http://c2c.yesky.com/book/html/2218.html
      

  3.   

    我仔细察看了一下那个代码,并不能达到正则转化的效果.因为里面不进行判断的直接把[*]-><*> [/*]-></*>
    以及无法进行一些关键字的屏蔽等我决定自己写一个UbbToHtml 的解释函数了 ^-^对你的帮助再次表示感谢 ^-^