In computer science, compressed pattern matching (abbreviated as CPM) is the process of searching for patterns in compressed data with little or no decompression.
If we are looking for an occurrence of a in the text we could obtain as result also an occurrence that is within the codeword of b: we call this event false match.
So we have to verify if the occurrence detected is effectively aligned on a codeword boundary.
However we could always decode the entire text and then apply a classic string matching algorithm, but this usually requires more space and time and often is not possible, for example if the compressed file is hosted online.
[1] Many strategies exist for finding the boundaries of codewords and avoiding full decompression of the text, for example: There were introduced algorithms that provide running time that grows logarithmically with the increase of string and pattern length.