ASP.NET C# 替换指定部分内容
<!--要替换内容-->
<li><a href="/xxx/2008-11-19/2934.html" target=_blank>xxxxxx</a></li>
<li><a href="/xxx/2008-11-19/2935.html" target=_blank>xxxxxx</a></li>
<li><a href="/xxx/2008-11-20/2936.html" target=_blank>xxxxxx</a></li>
<!--替换后的结果-->
<li><a href="/xxx_2008-11-19_2934.html" target=_blank>xxxxxx</a></li>
<li><a href="/xxx_2008-11-19_2935.html" target=_blank>xxxxxx</a></li>
<li><a href="/xxx_2008-11-20_2936.html" target=_blank>xxxxxx</a></li>
<li><a href="/xxx/2008-11-19/2934.html" target=_blank>xxxxxx</a></li>
<li><a href="/xxx/2008-11-19/2935.html" target=_blank>xxxxxx</a></li>
<li><a href="/xxx/2008-11-20/2936.html" target=_blank>xxxxxx</a></li>
<!--替换后的结果-->
<li><a href="/xxx_2008-11-19_2934.html" target=_blank>xxxxxx</a></li>
<li><a href="/xxx_2008-11-19_2935.html" target=_blank>xxxxxx</a></li>
<li><a href="/xxx_2008-11-20_2936.html" target=_blank>xxxxxx</a></li>
将超链接的内容“/”替换为“_”
str = Regex.Replace(str, @"href=""\/([^""]+)""", new MatchEvaluator(delegate(Match m) { return "href=\"/" + m.Groups[1].Value.Replace("/", "_") + "\""; }));