in reply to Re^2: Regular Expression to Match IP Address
in thread Regular Expression to Match IP Address
I don't see anything there about it, and even if you're correct...
It looks like wikipedia is not an authoratative source on IP addresses ;) I believe IPv4 is described in detail in RFC 791 (would someone please correct this if I gave the wrong rfc please!) IPv6 is detailed in RFC 2460.
IPv4 addresses are just 32 bit numbers that are displayed as a dotted quad for our convenience. It is much easier (at least to my eye) to look at and understand "10.0.0.1 netmask 255.255.255.0" than "167772161 netmask 4294967040", even though they are equivalent. Look at the following examples if you don't believe this.
perl -e 'print "true!" if 10 * 256**3 + 0 * 256**2 + 0 * 256 + 1 == 16 +7772161' # prints true!
or try this:
$ ping 167772161 PING 167772161 (10.0.0.1): 56 data bytes ^C --- 167772161 ping statistics --- 2 packets transmitted, 0 packets received, 100% packet loss
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |