求一正则表达式,简单,但我不会 假设有一个字符串为 s ,要把 s 里面的所有<br>和<br/>替换成 \n ,请问怎么写正则表达式?<br>和<br/>要不分大小写的。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果考虑还有</br>这种形式,可以这样Regex reg = new Regex(@"(?i)</?br\s*/?>");string result = reg.Replace(yourStr, "\n");richTextBox2.Text = result; string.prototype.replacebr=function(){ return this.replace("<br>","\n").replace("<br />","\n").replace("<BR>","\n").replace("<BR />","\n");}var str="<br>sdf";alert(str.replacebr); String... 感谢各位大侠的指点,尤其是 lxcnn 大侠,彻底解决了我的问题,再次致谢! 问:如何关闭 timer 控件 ? 怎么样识别gridview中的两个commandfield,让他们分别有不同的处理时间 诡异我问题 VS2005 TABCONTROL 请教Button的OnMouseEnter和OnMouseLeave 弱智问题:用VS2005怎样创建Web服务工程? 串口通信问题 label控件怎么继承一个shape类? 违反并发性: UpdateCommand 影响了预期 1 条记录中的 0 条 Index(索引符)如何用,谁给我一个例子? swfobject.js AD设置密码出错
string result = reg.Replace(yourStr, "\n");
richTextBox2.Text = result;
string.prototype.replacebr=function(){
return this.replace("<br>","\n").replace("<br />","\n").replace("<BR>","\n").replace("<BR />","\n");
}
var str="<br>sdf";
alert(str.replacebr);