More generic to allow a regex filter on the directory names