Fix pattern.

There will be at most 6 units in an IPv6 address if the last 32 bits
are in IPv4 format.
Allow trailing IPv4 with contractions.