How to use pattern matching conditioning

How to use pattern matching conditioning