Updated pattern matching to be case-insensitive