1.得到超链接中的链接地址:

string matchString = @"<a[^>]+href=\s*(?:'(?<href>[^']+)'|""(?<href>[^""]+)""|(?<href>[^>\s]+))\s*[^>]*>";

2.得到title标签中的值:

string matchString = @"<title>(?<title>.*)</title>";

3.去掉字符串中的所有html标记:

string temp = Regex.Replace(htmlStr, "<[^>]*>", "");

4.js去除字符串中的所有html标记:

function delHtmlTag(str)
{
    //去掉所有的html标记
    return str.replace(/<[^>]+>/g,"");
}

 

原文地址:http://cgxcn.blog.163.com/blog/static/1323124220095384043365/

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案