2 + 4
"Two plus four" consists of several constants or
literal values and an operator. A calculator program must
recognize, for instance, that "2" is a numeric constant and
that the plus sign represents an operator, not to
be interpreted as the "+" character.
An expression tells the computer how to produce a result. Although it
is the result of "two plus four" that we really want,
we don't simply tell the computer to return a six.
We instruct the computer to evaluate the expression and
return a value.
An expression can be more complicated than "2 + 4"; in fact, it
might consist of multiple simple expressions, such as
the following:
2 + 3 * 4
If you understand the difference between "." and "*" in regular
expressions, you already know about the two basic types of
metacharacters: those that can be evaluated to a single character, and
those that modify how preceding characters are evaluated.
It should also be apparent that
by use of metacharacters you can expand or limit the possible matches.
You have more control over what's matched and what's not.