Both IPv4 and IPv6 allow for some flexibility in how IP addresses are expressed as strings, but IPv6 really takes it to the max. How many ways can we express the all-zeroes IPv6 address, a.k.a. "::". Let's see.
::
Running count: 1.
0000:0000:0000:0000:0000:0000:0000:0000
is the same address. But each octet can also be expressed as either 0, 00, 000, or 0000. So that means that there are 4^8 ways to express "::" as 8 octets.
Running count: 65,537
0000::0000:0000:0000:0000:0000:0000
0000::0000:0000:0000:0000:0000
0000::0000:0000:0000:0000
these are also valid. As are ...
0000:0000::0000:0000:0000:0000:0000
0000:0000::0000:0000:0000:0000
0000:0000::0000:0000:0000
we can decrease the number of octets, and move the double colon. So we can add 4^7 * 6, 4^6 * 5, 4^5 * 4, 4^4 * 3, 4^3 * 2, and 4^2 to our list.
Running total: 189,329
We can also express the same address as:
::0.0.0.0
But each quad in the IPv4 part can be expressed as 0, 00, or 000. So we have 3^4 new possibilities.
Running total: 189,410
We can still expand the IPv6 part of that previous address. E.g.
0:0:0:0:0:0:0.0.0.0
Which means we can play the same tricks as before. So we need to add 4^6 * 3^4, 4^5 * 4 * 3^4, 4^4 * 4 * 3^4, 4^3 * 2 * 3^4, 4^2 * 3^4, to our set of expressions.
Running total: 926,834
That's 926,834 ways to express the same IP address! Wow. Canonicalizing IPv6 addresses in search functions is going to be very important.