As the name implies, pattern matching techniques aim to find meaning in data in the form of patterns that can be further analysed and used for explanation and prediction. Unlike pattern recognition however, in pattern matching the sequence of tokens under scrutiny often has to be an exact match for the pattern the algorithm is testing for. It is less about discovering patterns as it is about comparing new data with existing patterns for similarities and isolating those strings of matched patterns in a larger sequence of tokens. These matching subsections can then be easily replaced if necessary by the algorithm.
The idea of matching patterns to identify things is not a new one
Most patterns take the form of either sequences or tree structures. The latter are used by some programming languages as a tool to process data by looking at its structure and fitting it into the bigger picture accordingly. There is a special syntax in mathematical notation for expressing these tree patterns as well as ways to express execution and value retrieval with in those trees.
Though threes are very useful, they lack some of the key features that make regular expressions such a popular method of outlining pattern matching parameters. Techniques like backtracking, and the ability to program in alternative patterns to be tried one by one in order to amount to a very powerful, conditional search parameters make regular expressions an excellent choice for many pattern matching algorithms.
In addition, patterns may be used declaratively to make statements about data and instruct functions how to operate in a more flexible manner, if one can use them as arguments to functions, or elements of a data structure. This is one reason that is the case in many symbolic programming languages.© BrainMass Inc. brainmass.com May 31, 2020, 10:10 pm ad1c9bdddf