以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]字符串替换  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=103631)

--  作者:jyh7081
--  发布时间:2017/7/13 7:29:00
--  [求助]字符串替换
这句代码:
Tables(tname).Current(cname) = str.Replace("</p><p>",vbcrlf).Replace("<p>",vbcrlf).Replace("<br>",vbcrlf).Replace("</p>","").Replace("&nbsp;","").Replace(" ","")

我想把尖括号内以p或br  开头的代码  都像<p>、<br>一样替换成vbcrlf,怎样修改上面这句代码?
比如把这段代码整体替换成vbcrlf:

以下内容为程序代码:

1 <pstyle="font:16px24px微软雅黑;margin:12px0px0px110px;padding:0px;border:0pxcurrentcolor;border-image:none;text-align:left;color:rgb(0,0,0);text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;font-size-adjust:none;font-stretch:normal;background-color:rgb(253,252,248);-webkit-text-stroke-width:0px;"="">
2




--  作者:有点甜
--  发布时间:2017/7/13 8:56:00
--  

Dim html As String = "<p>123434<p>werieur<p><br/><br><br><P>343"

Dim strText As String = System.Text.RegularExpressions.Regex.Replace(html, "<br[/]*>|<p>", vbcrlf, System.Text.RegularExpressions.RegexOptions.IgnoreCase)

Return strText