Pattern matching: Difference between revisions

Content deleted Content added
disambiguating AIML (now a dab)
Taking away bold type around "sequence", since it is not the article name nor topic
Line 3:
{{For|the use of variable matching criteria in defining abstract patterns to match|regular expression}}
{{More citations needed|date=February 2011}}
In [[computer science]], '''pattern matching''' is the act of checking a given '''sequence''' of [[Lexical analysis#Token|tokens]] for the presence of the constituents of some [[pattern]]. In contrast to [[pattern recognition]], the match usually has to be exact: "either it will or will not be a match." The patterns generally have the form of either [[string (computer science)|sequences]] or [[tree structure]]s. Uses of pattern matching include outputting the locations (if any) of a pattern within a token sequence, to output some component of the matched pattern, and to substitute the matching pattern with some other token sequence (i.e., [[Regular expression|search and replace]]).
 
Sequence patterns (e.g., a text string) are often described using [[regular expression]]s and matched using techniques such as [[backtracking]].