Demo源码如下:
Demo下载地址:http://download.csdn.net/detail/zxcvbnm32123/5830571
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace _12提取html中的所有的Email地址
{
class Program
{
static void Main(string[] args)
{
string html = File.ReadAllText("1.htm");
//提取Email
//通过()提取组,正则表达式如下
string regEmail = @"([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9]+)(\.[a-zA-Z0-9])+";
MatchCollection mc = Regex.Matches(html, regEmail);
//请统计出常用邮件服务提供商的用户使用。
//163
//126
//sohu
//gmail
//qq
//sina
//ya