We study two pattern matching problems that are motivated by applications in computational biology. In the Closest Substring problem k strings s1, . . ., sk are given, and the task is to find a string s of length L such that each string si has a consecutive substring of length L whose distance is at most d from s. We present two algorithms that aim to be efficient for small fixed values of d and k: for some functions f and g, the algorithms have running time f(d)