Change search to use pattern.