有一段html要使用一次正则表达式,一次性地取出 标题,连接,日期 用##分隔,
注意是只用一次正则表达式<p>
<a href="http://newsalert.baidu.com/n_[2]http://auto.zgjrw.com/News/2008224/auto/276438819800.html" target="_blank"><font size="2"><b>雪佛兰Volt成本过高 关键在辅助电气系统</b></font></a> <font color=#6f6f6f size="1"> <nobr>中国金融网 2008-2-24 16:56</nobr></font><br>
<font size=-1>...只要当电动车大规模生产推出时,此类节能设备和系统成本才会下降。 雪佛兰volt概念车于2007年在上海<font color="#C60A00">车展</font>全球首发,该车将采用通用汽车最新研发的e-flex动力推进系统。该系统被业界喻为“真正改变了汽车的dna,是驱动汽车行业进入电气时代的先驱”  2008-2-24 16:56:36 盖世汽车网</font>
</p>

解决方案 »

  1.   

    (<p><a href="")(http[^""]+)("[^>]+><b>)([^<>]+)(.*?<nobr>)([^\d]+)([^<>]+)
    用replace
    然后 应该是 $4##$2##$7
    大概就是这个样子..
      

  2.   

    Match  m = Regex.Match(s, @"(?s)(?i)<a\s+href\s+=\s+""(?<link>[^""]*)""[^>]*>(?<title>.*?)</a>.*?(?<date>\d{4}-\d{1,2}-\d{1,2})");
    string t = string.Format("{0}##{1}##{2}", m.Groups["title"].Value, m.Groups["link"].Value, m.Groups["date"].Value);
      

  3.   

    Match  m = Regex.Match(s, @"(?s)(?i)<a\s+href\s+=\s+""(?<link>[^""]*)""[^>]*><font[^>]*><b>(?<title>.*?)</b></font></a>.*?(?<date>\d{4}-\d{1,2}-\d{1,2})");
    string t = string.Format("{0}##{1}##{2}", m.Groups["title"].Value, m.Groups["link"].Value, m.Groups["date"].Value);
      

  4.   

    上面的有错,改一下,把=两边的\s+改为\s*:
    Match  m = Regex.Match(s, @"(?s)(?i)<a\s+href\s*=\s*""(?<link>[^""]*)""[^>]*><font[^>]*><b>(?<title>.*?)</b></font></a>.*?(?<date>\d{4}-\d{1,2}-\d{1,2})");
    string t = string.Format("{0}##{1}##{2}", m.Groups["title"].Value, m.Groups["link"].Value, m.Groups["date"].Value);
      

  5.   

    Match  m = Regex.Match(s, @"(?s)(?i)<a\s+href\s*=\s*""(?<link>[^""]*)""[^>]*><font[^>]*><b>(?<title>.*?)</b></font></a>.*?<nobr>(?<site>.*?)\s+(?<date>\d{4}-\d{1,2}-\d{1,2}).*?</nobr></font><br>(?<text>.*?)</p>");
    string t = string.Format("{0}##{1}##{2}##{3}##{4}", m.Groups["title"].Value, m.Groups["link"].Value, m.Groups["site"].Value, m.Groups["date"].Value, m.Groups["text"].Value);