a method and system for identifying a bit pattern in a data stream including a plurality of bits each having a first or second state , the method includes identifying a number of mismatching bits , within a subset of the plurality of bits , having the first state and corresponding to a bit having the second state within the pattern ; identifying a number of bits in the subset having the first state ; and , identifying a number of bits in the pattern having the second state . a number of matches of between the subset and the pattern is dependent on the identified number of mismatching bits , the identified number of bits in the subset having the first state and the identified number of bits in the pattern having the second state .