62,026
社区成员
发帖
与我相关
我的任务
分享
string[] ss={"/a/b/c",
"/a/b/c.jpg",
"/a/b/c.html"};
Regex reg=new Regex(@"^\S+(?<!(gif|jpg|png))$");
foreach(string s in ss)
Console.WriteLine("{0}\t{1}",s,reg.IsMatch(s));
/*
/a/b/c True
/a/b/c.jpg False
/a/b/c.html True
*/
^/+[^.]*(?!(jpg|gif|png))$