16. The computer of claim 15 , wherein to rewrite the quantification to be implemented by the counter state machine element includes putting a portion of the quantification into the form of a sub-expression and a range, the range including a first threshold denoting a minimum repetition of the sub-expression and a second threshold denoting a maximum repetition of the sub-expression, the first threshold being greater than zero and the second threshold being greater than or equal to the first threshold.
15. A computer comprising: a memory including instructions stored thereon; and a processor communicatively coupled to the memory when the computer is in operation, wherein the instructions, when executed by the processor, cause the processor to: identify a quantification in a regular expression of source code; rewrite the quantification to be implemented by at least one of a counter state machine element of a target device or a set of general purpose state machine elements; identify portions of the rewritten quantification that can be implemented by the counter state machine element; determine whether the target device has an available counter state machine element for the identified portions; and unroll the identified portions if there is no available counter state machine element and assigning the identified portions to the available counter state machine element otherwise.