have a look here:
Instead of count e.g. return the filtered list with:
Messages(0).Attachments.Where(Function (x) Regex.IsMatch(Path.GetExtension(x.Name).ToUpper,Pattern)).toList
have a look here:
Instead of count e.g. return the filtered list with:
Messages(0).Attachments.Where(Function (x) Regex.IsMatch(Path.GetExtension(x.Name).ToUpper,Pattern)).toList