string strPat = "<a href=html/2008/.+?>";
            Match m = Regex.Match(sRet,strPat);
            while (m.Success)
            {
                sHref=m.ToString();
                Console.WriteLine(sHref);
                m = m.NextMatch();
            
            }
取一个网页的源码找出其中的连接,
那么 sHref 就是 <a href=html/2008/222.html> 这样的,
我就想要 .+? 这部分的, 
该怎么做? 谢谢

解决方案 »

  1.   

    暂时没测试环境,大概是这样的,试下吧            string strPat = "<a href=html/2008/(.+?)>"; 
                Match m = Regex.Match(sRet,strPat); 
                while (m.Success) 
                { 
                    sHref=m.Groups[1].Value; 
                    Console.WriteLine(sHref); 
                    m = m.NextMatch();           
                }