Answer:
Pattern matching in computer science is the checking and locating of specific sequences of data of some pattern among raw data or a sequence of tokens.
Pattern matching, in its classical form, involves the use of one-dimensional string matching. Patterns are either tree structures or sequences. There are different classes of programming languages and machines which make use of pattern matching. In the case of machines, the major classifications include deterministic finite state automata, deterministic pushdown automata, nondeterministic pushdown automata and Turing machines. Regular programming languages make use of regular expressions for pattern matching. Tree patterns are also used in certain programming languages like Haskell as a tool to process data based on the structure. Compared to regular expressions, tree patterns lack simplicity and efficiency.