Specifying Literal Dot Separators

Because the dot character is used as a wildcard in regular expressions and is also the standard separator for groups in IP addresses, domain names and host names, you can get unintended results when using wildcards. For example, this is a valid regular expression for IP addresses:

139.16.1.*

On Windows systems, many administrators would expect this to expression to "match any IP address with first-through-third groups of 139, 16 and 1 respectively" such as 139.16.1.10 and 139.16.1.35.

This would actually match either of these IP addresses:

139.16.1.10

139.16.11.120

In most cases, the difference between a literal dot and the dot as a wildcard character doesn’t make a difference. If you need to clarify a white list entry to match a literal dot, use \. instead.

The expression 139\.16\.1\..* would correctly match 139.16.1.10 and 139.16.1.35 but would not match 139.16.11.120. In many cases, you could also simplify this to 139.16.1\..* to get the correct behavior.