Added optional parameter to filter directory by regex