KMP exact pattern matching