Add optional keywords to pattern match