Added pattern based file and dir filtering