按网上的例子,但怎么匹配不成功的呢
string text = "I'vefoundthisamazingURLathttp://www.,andthenfindftp://ftp.string pattern = @"b(?<protocol>S+)://(?<address>S+)b";
MatchCollection mc = Regex.Matches(text,pattern);
Response.Write("文本中包含的URL地址有:");
foreach(Match match in mc)
{
GroupCollection gc = match.Groups;
string outputText = "URL:" + match.Value + ";Protocol:" + gc["protocol"].Value + ";Address:" + gc["address"].Value;
Response.Write(outputText);
}
都没有匹配到,为空, 哪里不对了