10.用正则表达式 提取网页中的网站链接
2014-11-30 20:47
337 查看
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace q提取网页中的网站链接
{
class Program
{
static void Main(string[] args)
{
string str = File.ReadAllText("1.htm",Encoding.UTF8);
MatchCollection ms = Regex.Matches(str, @"""(http://.+?)""");
if (ms.Count!=0)
{
for (int i = 0; i < ms.Count;i++ )
{
if (ms[i].Success)
{
Console.WriteLine(ms[i].Groups[1].Value);
}
}
}
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace q提取网页中的网站链接
{
class Program
{
static void Main(string[] args)
{
string str = File.ReadAllText("1.htm",Encoding.UTF8);
MatchCollection ms = Regex.Matches(str, @"""(http://.+?)""");
if (ms.Count!=0)
{
for (int i = 0; i < ms.Count;i++ )
{
if (ms[i].Success)
{
Console.WriteLine(ms[i].Groups[1].Value);
}
}
}
Console.ReadKey();
}
}
}
相关文章推荐
- 用正则表达式提取网页内容--选秀榜selectop.com网站内容管理系统之五
- 提取网页中链接和标题的正则表达式
- java 使用正则表达式从网页上提取网站标题
- Java正则表达式提取网页url和链接文字【2008年4月19日最新修改】
- 用HttpWebRequest和正则表达式提取网页中的链接
- 软件开发,创意是灵魂——用HttpWebRequest和正则表达式提取网页中的链接
- 提取网页中链接和标题的正则表达式
- java 使用正则表达式从网页上提取网站标题
- 用正则表达式提取网页中的链接
- java学习-- 使用正则表达式从网页上提取网站标题
- php 正则表达式提取网页超级链接url的函数
- 应用PHP正则表达式提取某网站中最新发表的代理ip地址
- 微软面试题:正则表达式提取链接地址
- asp.net正则表达式提取网页网址、标题、图片实例以及过滤所有HTML标签实例
- java正则表达式例程 提取网页中的email 统计代码的空行 有效代码行 注释行
- asp.net正则表达式提取网页网址、标题、图片,滤所有HTML标签
- 用正则表达式得到网页上的链接
- 正则表达式提取链接地址-邮箱邮件