一个发了三个帖没人解决的正则表达式问题 用正则表达式[img]http://www.baidu.com/aa.jpg[img]变成<img>http://www.baidu.com/aa.jpg[img]谁有基于c#的简易发帖编辑器,给我来一个地址,求各位大哥了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string strReg=@"([\[]img[\]])([^[\n]*)([\[]img[\]])"; string strText=@"[img]http://1www.basidu.com/aa.jpg[img][img]http://4www.bdaidu.com/aa.jpg[img]"; System.Text.RegularExpressions.MatchCollection _regc=Regex.Matches(strText,strReg,RegexOptions.Multiline); foreach(Match match in _regc) { strText=strText.Replace(match.Value ,@"<img>"+match.Groups[2].Value+match.Groups[3].Value ); } MessageBox.Show(strText); string strReg=@"([\[]img[\]])([^[\n]*)([\[]img[\]])"; string strText=@"[img]http://1www.basidu.com/aa.jpg[img][img]http://4www.bdaidu.com/aa.jpg[img]"; System.Text.RegularExpressions.MatchCollection _regc=Regex.Matches(strText,strReg,RegexOptions.Multiline); foreach(Match match in _regc) { strText=strText.Replace(match.Value ,@"<img>"+match.Groups[2].Value+match.Groups[3].Value ); } MessageBox.Show(strText); sqlserver数据导入问题 有关用C#调用VC的DLL的接口问题 datagridview的显示问题 接口有哪些好处? word操作问题 _____________ 能否将excel中的数据一行一行的读取?然后一行一行的写如到数据库中? C#实现随机概率的问题 写好的程序想移动要烤走哪个文件? 求救!程序无法运行! 在线等,控件捕捉鼠标事件延迟还是无法捕捉到?? 在dataGrid中如何把当前记录(Position)定位到某一条件的记录上,如字段:姓名="zxm"? 揭晓"数据更新"的内幕...(欢迎讨论)
string strText=@"[img]http://1www.basidu.com/aa.jpg[img][img]http://4www.bdaidu.com/aa.jpg[img]";
System.Text.RegularExpressions.MatchCollection _regc=Regex.Matches(strText,strReg,RegexOptions.Multiline);
foreach(Match match in _regc)
{
strText=strText.Replace(match.Value ,@"<img>"+match.Groups[2].Value+match.Groups[3].Value );
}
MessageBox.Show(strText);
string strText=@"[img]http://1www.basidu.com/aa.jpg[img][img]http://4www.bdaidu.com/aa.jpg[img]";
System.Text.RegularExpressions.MatchCollection _regc=Regex.Matches(strText,strReg,RegexOptions.Multiline);
foreach(Match match in _regc)
{
strText=strText.Replace(match.Value ,@"<img>"+match.Groups[2].Value+match.Groups[3].Value );
}
MessageBox.Show(strText);