Add a missing `re` import

This is used by the code checking whether to ignore a to-be-loaded
directory.