Simplifying and hardening omitFilesByMatching
Matching wont encounter undef variables when using foreach to index