Minor tweaks to generalize the regular expression used to find objects in each directory