{
str = htmlencode(str);
str = regex.replace(str, @"\[url](?<url>.+?)\[/url]", "<a href=${url} target=_blank>${url}</a>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[url=(?<url>.+?)](?<name>.+?)\[/url]", "<a href=${url} target=_blank>${name}</a>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[email](?<email>.+?)\[/email]", "<a href=mailt${email} target=_blank>${email}</a>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[email=(?<email>.+?)](?<name>.+?)\[/email]", "<a href=mailt${email} target=_blank>${name}</a>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[flash](?<flash>.+?)\[/flash]", "<div style=width:640;text-align:left><a href=${flash}>[\u5168\u5c4f\u67e5\u770b]</a></div><object codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=640 height=480><param name=movie value=${flash}><param name=quality value=high><embed src=${flash} quality=high pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash type=application/x-shockwave-flash width=640 height=480></embed></object>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[dir=(?<width>[0-9]+?),(?<height>[0-9]+?)](?<url>.+?)\[/dir]", "<object classid=clsid:166b1bca-3f9c-11cf-8075-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0 width=${width} height=${height}><param name=src value=${url}><embed src=${url} pluginspage=http://www.macromedia.com/shockwave/download/ width=${width} height=${height}></embed></object>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[rm=(?<width>[0-9]+?),(?<height>[0-9]+?)](?<url>.+?)\[/rm]", "<object classid=clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa class=object id=raocx width=${width} height=${height}><param name=src value=${url}><param name=console value=clip1><param name=controls value=imagewindow><param name=autostart value=true></object><br><object classid=clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa height=32 id=video2 width=${width}><param name=src value=${url}><param name=autostart value=-1><param name=controls value=controlpanel><param name=console value=clip1></object>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[mp=(?<width>[0-9]+?),(?<height>[0-9]+?)](?<url>.+?)\[/mp]", "<object align=middle classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=object id=mediaplayer width=${width} height=${height} ><param name=showstatusbar value=-1><param name=filename value=${url}><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701 flename=mp src=${url} width=${width} height=${height}></embed></object>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[qt=(?<width>[0-9]+?),(?<height>[0-9]+?)](?<url>.+?)\[/qt]", "<embed src=${url} width=${width} height=${height} autoplay=true loop=false controller=true playeveryframe=false cache=false scale=tofit bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[img](?<img>.+?)\[/img]", "<a href=${img} target=_blank><img src=${img} border=0 ></a>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[color=(?<color>.+?)](?<text>.+?)\[/color]", "<font color=${color}>${text}</font>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[face=(?<face>.+?)](?<text>.+?)\[/face]", "<font face=${face}>${text}</font>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[down=(?<file>.+?)](?<text>.+?)\[/down]", "<a href=${file} target=_blank>${text}</a>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[align=(?<align>.+?)](?<text>.+?)\[/align]", "<div align=${align}>${text}</div>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[quote](?<text>.+?)\[/quote]", "<div class=quote>${text}</div>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\(?<text>.+?)\", "<i>${text}</i>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[u](?<text>.+?)\[/u]", "<u>${text}</u>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\(?<text>.+?)\", "<b>${text}</b>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[size=(?<size>.+?)](?<text>.+?)\[/size]", "<font size=${size}>${text}</font>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[\*](?<text>.+?)\[/\*]", "<li>${text}</li>", regexoptions.compiled | regexoptions.ignorecase);
str = regex.replace(str, @"\[list](?<text>.+?)\[/list]", "<ul>${text}</ul>", regexoptions.compiled | regexoptions.ignorecase);
return regex.replace(str, @"\[list=(?<type>.+?)](?<text>.+?)\[/list]", "<ol type=${type}>${text}</ol id=${type}>", regexoptions.compiled | regexoptions.ignorecase);
}
文章整理:站长天空 网址:http://www.z6688.com/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




