Expression for Directory.GetFiles

Hi,

Unfortunately, GetFiles doesn’t support regex filter as the following document.

Can you try to use LINQ as the following, for example.

 System.IO.Directory.GetFiles(FilePaths1).Where(Function(f) System.Text.RegularExpressions.Regex.IsMatch(System.IO.Path.GetFileName(f),"(PAN|CHEQUE|GST).*.pdf|jpeg$")).ToArray

Regards,

2 Likes