MatchQ

In order for a pattern to match an expression, the pattern and the expression

it is compared with must have the same FullForm after evaluation. For

example the expression a/b has the FullForm Times[a,Power[b,-1]], so it

doesn't match the pattern (_Rational). MatchQ is a very good tool to use

when testing a pattern to see if it matches the intended expressions. Some

interesting examples of MatchQ are given below.

The head HoldPattern used in next cell is explained in another section.

I don't provide further examples, but any combination of pattern matching constructs can be used with MatchQ. Nuances of pattern matching are discussed in another section.

Created by Mathematica (May 16, 2004)