A Unified Model of Pattern-Matching Circuits for Field-Programmable Gate Arrays