C#替换了这些标签之间的所有内容

| 如果有人在我网站的产品页面上,我想覆盖一个元描述标签。
<meta name=\"description\" content=\" \" /> 
我正在使用的CMS在其页面模板的pre-render方法中具有以下代码:
this.ltlTags.Text = this.HeaderTags; 
这将使用meta标签,CSS标签,脚本标签以及所有内容填充标头。 我想说这样的话:
this.ltlTags.Text = this.HeaderTags.Replace(
    \"everything inside the content attribute of the meta tag\", \"with this text\"); 
在C#中,有什么方法可以实现呢?     
已邀请:
这样的事情应该起作用(未经测试):
this.ltlTags.Text = Regex.Replace(this.HeaderTags,
    \"content=\\\"[^\\\"]*\\\"\", \"content=\\\"\" + yourStuff + \"\\\"\");
它基本上将
content=\"<anything>\"
替换为
content=\"<yourStuff>\"
。     
您能替换整个标签吗?我的意思是
this.ltlTags.Text = this.HeaderTags.Replace(\"<meta name=\\\"description\\\" content=\\\" \\\" />\",
                          \"<meta name=\\\"description\\\" content=\\\"new text here\\\" />\");
    

要回复问题请先登录注册