You could match with the following regular expression.
(?
Start your engine!
The negative lookarounds are to avoid matching .1.3.164.1 and 1.3.164.1.. Including \d in the lookarounds is to avoid matching 1.3.16 in 1.3.164.1..
Java's regex engine performs the following operations.
(?