我有一些HTML: -
<blockquote>This is a quote</blockquote>
<p>This is the main post</p>
我想删除blockquote及其内容 。我试过了: -
string strippedPost = Regex.Replace(post, "<blockquote>(.*?)</blockquote>", "");
但没有任何运气。正则表达式有问题吗?
更新:也尝试了
string strippedPost = Regex.Replace(post, @"<blockquote>(.*?)<\/blockquote>", "");
答案 0 :(得分:0)
你能试试吗?
strippedPost = Regex.Replace(post, "<blockquote>(.|\n)*?</blockquote>", "");