懂得放弃,才会有新的收获!

ubb转html,html转ubb

By weisnet On 2009-05-04 At 20:18 View:273
试例:[Popid=25]观点[/Popid] 转成 <a href='javascript:ShowView(25)' style='text-decoration:underline;'>观点</a>
 
UBB转HTML:
string Cont = "[Popid=25]观点[/Popid]";
Regex rg=new Regex(@"\[Popid\=([0-9]+)\](.+)\[\/Popid\]",RegexOptions.IgnoreCase);
   Cont = rg.Replace(Cont,@" <a href='javascript:ShowView($1)' style='text-decoration:underline;'>观点</a>");
 
HTML转UBB:
string Cont = "<a href='javascript:ShowView(25)' style='text-decoration:underline;'>观点</a>";
Regex rg=new Regex(@" \<a href=\'javascript:ShowView\(([0-9]+)\)\' style=\'text-decoration:underline;\'\>观点\<\/a\>");
Cont  = rg.Replace(Cont.Trim(),@"[Popid=$1][/Popid]");
·上一篇:Request.Form('content1')与content1.value
·下一篇:关于 href='#' 跳动到顶部的问题!

for this post

 
 

Leave a Reply

赶快抢个沙发坐坐!
请先 登陆  还没帐号

Hot Posts Powered by weiseditor

  • Add to Google

Friend links