Asp.net 如何使用正则表达式替换此html
我对regex有点陌生,如果你能帮助我了解如何替换 使用正则表达式将转义字符返回到文本html字符串,我将非常感激。 我尝试使用string.replace,它只替换了代码的某些部分,而不是全部Asp.net 如何使用正则表达式替换此html,asp.net,regex,replace,Asp.net,Regex,Replace,我对regex有点陌生,如果你能帮助我了解如何替换 使用正则表达式将转义字符返回到文本html字符串,我将非常感激。 我尝试使用string.replace,它只替换了代码的某些部分,而不是全部 例如:string.replace(“,”如果您的字符串是HTML编码的,您最好通过Server.HtmlDecode()运行它。这将把它转换回HTML 即 .NET中的String.Replace()替换所有实例。将这些行放在一起并批量替换。 <div class="ExternalClass2
例如:
string.replace(“,”如果您的字符串是HTML编码的,您最好通过Server.HtmlDecode()
运行它。这将把它转换回HTML
即
.NET中的String.Replace()替换所有实例。将这些行放在一起并批量替换。
<div class="ExternalClass2BF55814E98A409296EC90A2605D7D74">
<div><iframe src="
<a href=http://player.vimeo.com/video/32001208?portrait=0&ampbadge=0>
http://player.vimeo.com/video/32001208?portrait=0&ampbadge=0
</a>"
width="420" height="281" frameborder="0"
webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div>
</div>
'' In VB
Dim myHtml as String = Server.HtmlDecode(YourConcatonatedEncodedHTML)
// in C#
string myHtml = Server.HtmlDecode(YourConcatonatedEncodedHTML);