We study the problem of indexing a text T[1..n] such that whenever a pattern P[1..p] and an interval [a,b] come as a query, we can report all pairs (i,j) of consecutive occurrences of P in T with a <e; j-i <e; b. We present an O(n log n space data structure with optimal O(p+k) query time, where k is the output size.