Improve non-greedy matching