Hola petete2008, tendrías que hacerlo con las funciones FindFirst, FindNext y Pos:
Código Delphi
[-]
var
sr: TSearchRec;
Ind : Integer;
begin
cadena := '543';
Try
If FindFirst(Path + '*'+cadena+'*.*', faArchive, sr) = 0 Then
Repeat
Ind := Pos(cadena, sr.Name);
if not(sr.Name[Ind+Length(cadena)] in ['1'..'9']) then
showmessage(sr.Name);
until FindNext(sr) <> 0;
end;
Finally
FindClose(sr);
end;
end;
Saluditos