basic key pattern matching