prefix suffix and middle matching