Correctly quote search patterns.