Probabilistic Pattern Matching