终于有人来了 
 其实这个网页很有规律的 而且全是以表格的形式http://qq.ip138.com/train/index.htm 这个网站的
 我想提取这些入库
之后做个检索模块
提供列车时刻查询 
见笑了啊  因为第一次做 没经验  所以贴出来了 希望大家帮帮忙
这个是我的学校项目

解决方案 »

  1.   


     <tr   onmouseover="this.bgColor='#E6F2E7';"   onmouseout="this.bgColor=''"> <td   bgcolor="#CCE6CD"> <a   href="/train/.+"> <b> (?<checi>[^<].*)</b> </a> </td> <td> (?<leixing>[^<].*)</td>   <td> (?<shifazhan>[^<].*)</td> <td> (?<shifashijian>[^<].*)</td> <td> (?<jinguozhan>[^<].*) </td>   <td> (?<jinguozhanshijian1>[^<].*)</td>   <td> (?<jinguozhanshijian2>[^<].*)</td>   <td> (?<zhongdianzhan>[^<].*)</td> <td> (?<daozhanshijian>[^<].*) </td> </tr>//很久没写正则了,懒的测试了...
      

  2.   

    简单点的做法可以这样,但是适用范围有限,换个页面不符合这个规律就不能用了,不过话说回来,正则就是要根据具体问题来写,没有真正通用的,否则也就失去正则表达式的作用了MatchCollection mc = Regex.Matches(str, @"<td[^>]*>[\s\S]*?</td>", RegexOptions.IgnoreCase);
    for(int i=1;i<=mc.Count;i++)
    {
        if(i%9 != 0)
            richTextBox1.Text += Regex.Replace(mc[i-1].Value, @"<[^>]*>", "").Trim() + "  ";
        else
            richTextBox1.Text += Regex.Replace(mc[i-1].Value, @"<[^>]*>", "").Trim() + "\n";
    }
      

  3.   

    这么个规律
      onmouseout="this.style.backgroundColor=''"> 列名 </th> 
      <td> 内容 </td>