62,047
社区成员
发帖
与我相关
我的任务
分享
string s2 = "http://sports.sina.com.cn/chinaa/changchun/abc.js http://abc.ddd.cn/ty/21.jpg http://sports.sina.com.cn/z/afc_cl2008/aaaa.css ";
s2 += "http://abc.ddd.cn/009.gif http://abc.ddd.cn/ty/21.html http://abc.ddd.cn/ty/21.aspx?abc=ddd&name=jason";
Regex re = new Regex(@"(?>http://([\w-_]+\.)+[\w-_]+[\w-_%:/]*\.)(?!gif|jpg|css|js)([\w-_:./?%&=]*)?", RegexOptions.IgnoreCase);
MatchCollection matchesFound = re.Matches(s2);
foreach (Match match in matchesFound)
{
Console.WriteLine(match.Value);
}