Add support for a base dir and regex.