1. A method comprising: sampling text in a received packet at a network device; and analyzing the sampled text using a sampled deterministic finite automata (DFA) to identify matches between a set of regular expressions and the text, the sampled DFA created with said regular expressions sampled at a sampling rate, the sampling rate calculated for said regular expressions using operations comprising selecting a minimum sampling rate from sampling rates computed for each of said regular expressions based on a minimum length of the text that can match said regular expression; wherein the minimum length comprises a sum of lengths of substrings in said regular expression.