Network devices are increasingly using packet content for processing incoming or outgoing packets. Deep packet inspection, as the process is called, arises as networks incorporate increasingly sophisticated services into their infrastructure-true. Such services use application-specified data found in packet payloads, for example, to make routing decisions, to block or rate-limit unwanted trace to perform intrusion detection, and to provide quality of service. Pattern matching is one of the most important components for the content inspection based applications of network security. In this paper, the authors propose, Extended Cached Deterministic Finite Automata (ECDFA) for pattern matching. Also proposes an updating function ECDFA it reduces the running time.