A lazy Knuth-Morris-Pratt that works on a Input Range: http://ideone.com/dUs5B Do you have suggestions for improvements of the code? Maybe do I have to turn it into a Forward Range if the first range is a Forward one? Is something similar to this useful for Phobos? Bye and thank you, bearophile