It's not currently possible to find directories ending with bar, i.e. bar$. This is because one should actually type bar/$ because directories have trailing slashes (see also #1315). I think we could strip the slashes before applying regexps for directories.