The special meaning of some metacharacters is dependent on their position in the regular expression, for example the start and end of line indicators. However, most metacharacters retain their special meaning irrespective of location. How then can they used as literal characters?
In such cases, the backslash (\) is used is used to ``escape'' the
special meaning of the character that follows it. For example, \$
matches the ``$'' symbol rather than the end of a line. For
Summer sale now on\. Save $$\$
The backslash is used to quote the period and the final dollar sign (the other dollar signs are position-sensitive, and have no special meaning).
Because the backslash itself may be required to have only its literal meaning, \\ matches ``\'': the first backslash removes the special meaning from the second.