普通EX pression从网页解析链接?(Regular expression for parsing links from a webpage)

   IT问题网   2018-09-20 00:00:00

问 题

我在寻找一个.net正ex pression提取网页中的所有网址,但还没有找到一个为com prehensive足以涵盖所有你可以指定一个环节的不同方式。

和侧面的问题:

有"一正则表达式来统治他们所有"?还是我最好使用一系列不太复杂的常规ex pressions,只是采用复式通过对原始的html? (速度与可维护性)

解决方案

((邮寄地址\:|(新闻|(ht | f)tp(s))\:/ /){1} \ s +)

我把这个从 regexlib.com

[编者注:{1}在此正则表达式没有真正的功能; 看到这个帖子]

标签:普通网页解析链接



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

为什么一个字典"没有下令"?(Why is a Dictionary "not ordered")

problem i have read this in answer to many questions on h ...

是否Stream.Dispose随时拨打Stream.Close(和Stream.Flush)(Does Stream.Dispose always call Stream.Close (and Stream.Flush))

problem if i have the following situation: streamwriter ...

.NET(C#):获取子窗口时,你只有一个进程句柄或PID?(.NET (C#): Getting child windows when you only have a process handle or PID)

problem kind of a special case problem: i start a proce ...

为什么这个简单的.NET控制台应用程序有这么多线程?(Why does this simple .NET console app have so many threads)

problem this simple program starts with 15 threads - acco ...

循环引用导致内存泄漏?(Circular References Cause Memory Leak)

problem i'm trying to run down a memory leak in a windows ...

为什么不能在一个嵌套的局部范围内重复的变量名声明?(Why can't a duplicate variable name be declared in a nested local scope)

problem based on this recent question, i don't understand ...

LINQ的int值的字符串(Linq int to string)

problem how do i cast and int into a string none of the f ...

如何安装.NET Framework它尚未安装,只有当?(How to install .NET Framework only when it's not already installed)

problem is there a way to check if the .net framework 4 h ...

最好的方法从数据表中删除重复项(Best way to remove duplicate entries from a data table)

problem what is the best way to remove duplicate entries ...

如何检测Windows关机或注销(How to detect Windows shutdown or logoff)

problem i need to detect when windows is shutdown (or res ...

C#INT,的Int32和枚举(C# int, Int32 and enums)

problem if int is synonymous to int32 why does enum mye ...

什么是最简单的C#函数来分析JSON字符串转换成一个对象?(What is the simplest C# function to parse a JSON string into an object)

problem what is the simplest c# function to parse a json ...

是String.Contains()比String.IndexOf快()?(Is String.Contains() faster than String.IndexOf())

problem i have a string buffer of about 2000 ...

将code在最后声明火如果我在Try块返回一个值?(Will code in a Finally statement fire if I return a value in a Try block)

problem i'm reviewing some code for a friend and say that ...

要求Windows Vista的UAC提升,如果路径保护?(Request Windows Vista UAC elevation if path is protected)

problem for my c# app, i don't want to always prompt for ...

哪里Application.DoEvents()在WPF?(Where is the Application.DoEvents() in WPF)

problem i have the following sample code that ...

我可以使用任务并行库在.NET 3.5的项目?(Can I use the task parallel library in a .Net 3.5 project)

problem i heard that the task parallel library can be use ...

为什么C#多维数组没有实现IEnumerable T?(Why do C# Multidimensional arrays not implement IEnumerable<T>)

problem i have just noticed that a multidimensional array ...

等到过程结束(Wait till a process ends)

problem i've an application which does process.start() ...

匿名类型 - 有什么可区别的特点?(Anonymous Types - Are there any distingushing characteristics)

problem is there anything to use, to determine if a type ...