find: add conditional support for -maxdepth and -regex