Streszczenie:We generalize the well-known Karp-Rabin string matching to handle multiple patterns in O(nlogn+m) time and O(s) space, where n is the length of the text and m is the total length of the s patterns, returning correct answers with high probability. As a prime application of our algorithm, we show how to approximate the LZ77 parse of a string of length n. If the optimal parse consists of z phrases, using only O(z) working space we can return a parse consisting of at most (1+ε)z phrases in O(1/ε n logn) time, for any ε∈(0,1].