1 得到网页上的链接地址:
string strRegex = @"<a[^>]+href=/s*(?:'(?<href>[^']+)'|""(?<href>[^""]+)""|(?<href>[^>/s]+))/s*[^>]*>";
string strRegex = "href=[///" ///'](http://////|//.///|///)?//w+(//.//w+)*(/////w+(//.//w+)?)*(///|//?//w*=//w*(&//w*=//w*)*)?[///"///']";
2 得到网页的标题:
<title/b[^>]*>(?<text>[^<]+)<//s*title/s*>
3 得到keywords
<meta/b[/s/S]*name=""keywords""/scontent=""(?<key>[^""]*)""[^>]*>
4 去掉网页中的所有的html标记:
string strRegex = Regex.Replace(html, "<[^>]*>", ""); //html是一个要去除html标记的文档
string strRegex = @"<a[^>]+href=/s*(?:'(?<href>[^']+)'|""(?<href>[^""]+)""|(?<href>[^>/s]+))/s*[^>]*>";
string strRegex = "href=[///" ///'](http://////|//.///|///)?//w+(//.//w+)*(/////w+(//.//w+)?)*(///|//?//w*=//w*(&//w*=//w*)*)?[///"///']";
2 得到网页的标题:
<title/b[^>]*>(?<text>[^<]+)<//s*title/s*>
3 得到keywords
<meta/b[/s/S]*name=""keywords""/scontent=""(?<key>[^""]*)""[^>]*>
4 去掉网页中的所有的html标记:
string strRegex = Regex.Replace(html, "<[^>]*>", ""); //html是一个要去除html标记的文档