Exact pattern matching using the Z algorithm.