Exact matching tests for a
string entirely matching a given
pattern. You specify exact matching by using the
==
equality relational with one pattern
operand and one
string
operand (order irrelevant). For example,
"foo" == /foo|bar/
yields true, while
/foo|bar/ == "foobar"
yields false. The !=
operator is the negation of the ==
operator, just as when comparing strings or numerics.
Note that for exact matching, the ^
(anchor to beginning-of-line)
and $
(anchor to end-of-line) regular expression operators are
redundant: since the match is exact, every pattern is implicitly
anchored to the beginning and end of the line.