Basic pattern matching