Simplify grep pattern matching