2015-05-20 82 views
1

我使用C#從bing.com獲取一些網站。我用正則表達式:C#正則表達式獲取url

MatchCollection list_rv_url = Regex.Matches(htmlCode, @"<cite>(?<Domain>[\[email protected]][\w.:@]+)</cite>"); 

我只收到

www.example.com and example.com. 

我想

http://example.com, https://example.com,http://www.example.com, https://www.example.com 

感謝您的幫助!

+1

提供您輸入的字符串? –

+0

閱讀bing.com的資源http://www.bing.com/search?q=ip%3A118.69.123.137&qs=n&form=QBLH&pq=ip%3A118.69.123.137&sc=0-3&sp=-1&sk=&cvid= 5673cc21ba424b61882db602c412f467 –

回答

1

在匹配模式包括/

Regex.Matches(htmlCode, @"<cite>(?<Domain>[\[email protected]][\w.:@/]+)</cite>"); 
                ^