本帖最后由 test20140829 于 2014-08-29 11:05:07 编辑

解决方案 »

  1.   

    http://www.cnblogs.com/wuhuisheng/archive/2011/03/22/1991543.html
      

  2.   

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Text.RegularExpressions;namespace vs_2010_test_pass
    {
        class Program
        {
            static void Main(string[] args)
            {
                string text = @"<td class=bgColor>女</td><td>冯金</td><td colspan=2>222224197112222202</td><td>1972-12-22</td><td class=bgColor>男</td><td>张三</td><td colspan=2>222224197212222202</td><td>1972-12-22</td>";
                string rex = @"\d{15}|\d{18}";
                Regex r = new Regex(rex, RegexOptions.IgnoreCase);
                MatchCollection m = r.Matches(text);            for (int i = 0; i < m.Count; i++)
                {
                    Match match = m[i];
                    Console.WriteLine("Match[{0}]========================", i);
                    for (int j = 0; j < match.Groups.Count; j++)
                    {
                        Console.WriteLine("Groups[{0}]={1}", j, match.Groups[j].Value);
                    }
                }            Console.ReadLine();
            }
        }
    }
      

  3.   

    身份证号码是否都在<td colspan="2"></td>里面?那就可以根据这个固定来取了