Case insensitive and pattern matching

This is for issue #1724
1) Are non-strings valid arguments?

2) Assuming they are, it would be better to check that explicitly w/ `isinstance`. Catching `AttributeError`, especially with this big block, is a bit risky because it can mask bugs.