我正在尝试从给出的文本中提取网站(例如http://www.yogacenter.com:4355 )。但我没有得到任何匹配下面的代码。有什么建议么 ?
string pattern = @"\b(\S+)://(S+)(?::(\S+))?\b";
string text = "i have just found this http://wwww.yogacenter.com:4355 at my place.It's a http:// site.";
MatchCollection mc = Regex.Matches(text, pattern);
foreach (Match item in mc)
{
Console.WriteLine(item.Value);
}