<!--要替换内容-->
<li><href="/xxx/2008-11-19/2934.html" target=_blank>xxxxxx</a></li>
<li><href="/xxx/2008-11-19/2935.html" target=_blank>xxxxxx</a></li>
<li><href="/xxx/2008-11-20/2936.html" target=_blank>xxxxxx</a></li>

<!--替换后的结果-->
<li><href="/xxx_2008-11-19_2934.html" target=_blank>xxxxxx</a></li>
<li><href="/xxx_2008-11-19_2935.html" target=_blank>xxxxxx</a></li>
<li><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("/""_") + "\""; }));

相关文章:

  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案