Add regex filter to 'configdir'

This commit adds a regex to the 'configdir' function to filter out the
last directory of the given title.