求正则表达式,取出title的值<DIV class=cookie_title>最近查询记录</DIV>
<DIV class=cookie_content>
<TABLE cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD class=rank_left><A title=www.985.net href="http://alexa.chinaz.com/Cache/2013/3/22/985.net@Alexa_More.asp" target=_blank>985.net</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.9r.cn href="http://www.9r.cn" target=_blank>9r.cn</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.chexun.com href="http://www.chexun.com" target=_blank>chexun.com</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.30kw.com href="http://alexa.chinaz.com/Cache/2013/3/22/30kw.com@Alexa_More.asp" target=_blank>30kw.com</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.jqw.com.cn href="http://alexa.chinaz.com/Cache/2013/3/22/jqw.com.cn@Alexa_More.asp" target=_blank>jqw.com.cn</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.okaidoku.net href="http://alexa.chinaz.com/Cache/2013/3/22/okaidoku.net@Alexa_More.asp" target=_blank>okaidoku.net</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.soupv.com href="http://alexa.chinaz.com/Cache/2013/3/22/soupv.com@Alexa_More.asp" target=_blank>soupv.com</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.120top.cn href="http://alexa.chinaz.com/Cache/2013/3/22/120top.cn@Alexa_More.asp" target=_blank>120top.cn</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.integrity-plus-property-management.com href="http://alexa.chinaz.com/Cache/2013/3/22/integrity-plus-property-management.com@Alexa_More.asp" target=_blank>integrity-plus</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.2819798114.net href="http://alexa.chinaz.com/Cache/2013/3/22/2819798114.net@Alexa_More.asp" target=_blank>2819798114.net</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.insanejournal.com href="http://alexa.chinaz.com/Cache/2013/3/22/insanejournal.com@Alexa_More.asp" target=_blank>insanejournal.</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.wap.ai href="http://alexa.chinaz.com/Cache/2013/3/22/wap.ai@Alexa_More.asp" target=_blank>wap.ai</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.2sniadanie.pl href="http://alexa.chinaz.com/Cache/2013/3/22/2sniadanie.pl@Alexa_More.asp" target=_blank>2sniadanie.pl</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.cnlad.com href="http://alexa.chinaz.com/Cache/2013/3/22/cnlad.com@Alexa_More.asp" target=_blank>cnlad.com</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.31dianzi.cn href="http://alexa.chinaz.com/Cache/2013/3/22/31dianzi.cn@Alexa_More.asp" target=_blank>31dianzi.cn</A></TD></TR>
<TR>
<TD class=rank_left><A title=www.14114.cn href="http://alexa.chinaz.com/Cache/2013/3/22/14114.cn@Alexa_More.asp" target=_blank>14114.cn</A></TD></TR></TBODY></TABLE></DIV>正则表达式.nettable

解决方案 »

  1.   

    不需要正则,用js取出所有a标签,取出这些a标签title属性的值就可以了。
      

  2.   


      string txt = System.IO.File.ReadAllText("1.txt");
                var val = Regex.Matches(txt, "(?is)<A.title=(.*?)href=.*?>").OfType<Match>().Select(x=>x.Groups[1]);
                foreach (var item in val)
                {
                    Console.WriteLine(item);
                }效果