와 나는 빙 HTML을하고 난 그것을에서 결과를 분석 할 :구문 분석 HTML 정규식
string BingRegex = "<div class=\"sb_tlst\"><h3><a href=\"(.*?)\"";
string[] results = Regex.Matches(responseStr, BingRegex).Cast<Match>().Select(m => m.Value).ToArray();
나는 배열에 결과를 얻을 수 있지만 각 결과에 패턴을 추가, 뭔가 같은 :
<div class=\"sb_tlst\"><h3><a href=\"www.cnn.com\"
<div class=\"sb_tlst\"><h3><a href=\"www.google.com\"
<div class=\"sb_tlst\"><h3><a href=\"www.gmail.com\"
어떤 아이디어로도이 문제를 해결하고 URL 만 얻을 수 있습니까?
html을 구문 분석하기 위해 정규식을 사용하지 마십시오. – gleng
참조 http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags –
잘 할 수 있지만 빨리 잘못 될 것입니다. –