Backslash (\) and Dot (.)

Created by: LunaMetrics on 20 February 2008
Last updated by: LunaMetrics on 20 February 2008

Backslash

Use a backslash to turn any special character into a literal character (i.e. “escape”, a character).

Although the backslash can be used with any special character, it is most often used with a dot. This is because a dot is both a special character and one that is used as part of URLs (Example: www.myspace.com — the dot appears twice.) In the case of URLs, you'll need to use a backslash as follows: mysite\.com. Here is an example of how an IP address would need to be typed: 64\.68\.82\.164

Dot

The dot is used to match any one character. For example,

.ate

will match late, date, sate or any four-character expression. It will also match 8ate (the character doesn't have to be a letter.) However, it won't match ate, because one character must substitute for the dot.

Here's why backslash and dot are so often used together. In this expression:

homepage.com

In the dot is a wild card that stands for any one character. This expression will match homepagescom and homepage4com and homepagedcom. If you really want to match homepage.com, you'll need to use a backslash like this: homepage\.com.