A test and measurement instrument includes a user interface (1020) and a controller (1005). The controller is configured to receive a serial bit stream and apply a logic (1010) to the serial bit stream to identify states within the serial bit stream. The result of applying the logic to the serial bit stream is a combined state/bit stream. A regular expression can be applied (1015) to the combined state/bit stream: the regular expression can include state information (1025). The controller is also configured to present output data through the user interface in response to the application of the regular expression to the combined state/bit stream.