Fixes #2914 make include_pat and exclude_pat actually work

Fixes #2914