Case insensitive and pattern matching

This replaces pull request #1751. This is for issue #1724.
I renamed ```_get_and_compile_regexp``` to ```_glob_pattern_to_regexp```, but I'm wondering if you meant I should rename ```_yield_regexp``` instead.