Код: Выделить всё
string dirPath = "C:/path/to/file/";
string fileNamePre = "AnLe";
string regExSuf = @"[A-Z0-9_]*(?!ZANG)\.xml";
Regex rg = new Regex("^" + dirPath + fileNamePre + regExSuf + "$");
string[] fileNames = new[] {"AnLe.xml","AnLe_ZANG.xml","AnLe_TE.xml"};
IEnumerable resultFilePaths = fileNames.Select(element => dirPath + element).Where(element => {
return rg.IsMatch(element);
});
Подробнее здесь: https://stackoverflow.com/questions/792 ... by-ismatch
Мобильная версия