C# .NET 使用正则获取a标签href属性

2023-07-31 17:29:32 码农 1385
MatchCollection matches = Regex.Matches(content, @"<a[^>]*href=([""'])?(?<href>[^'""]+)\1[^>]*>", RegexOptions.IgnoreCase);
foreach (Match item in matches)
{
  var href= item.Groups[1].Value;
}
—— 完 ——
  • HTML meta标签 遇到http-equiv=refresh content=0; url=详解
  • C#实现把double存成两位精度小数
  • C#中的TimeSpan结构
  • C#.NET 利用PerformanceCounter类获取CPU各个核心使用率
  • Unity中LitJson插件的使用
  • 下列各方中,通常不属于审计报告预期使用者的是( )。
  • C#连接SQLite数据库连接字符串
  • .NET SDKs installed: No SDKs were found的解决方案
  • C#与C++的区别
  • C#防SQL注入帮助类

© CopyRight 2014~2024 薄学网.