Validating ip address


18-Aug-2016 15:31

/bin/sh WORD="[0-9A-Fa-f]\" # flat address, no compressed words FLAT="^$\(:$\)$" # ::'s compressions excluding beginning and end edge cases COMP2="^\($:\)\(:$\)$" COMP3="^\($:\)\(:$\)$" COMP4="^\($:\)\(:$\)$" COMP5="^\($:\)\(:$\)$" COMP6="^\($:\)\(:$\)$" COMP7="^\($:\)\(:$\)$" # trailing :: edge case, includes case of only :: (all 0's) EDGE_TAIL="^\(\($:\)\|:\):$" # leading :: edge case EDGE_LEAD="^:\(:$\)$" is_ipv6 () is_ipv6

/bin/sh WORD="[0-9A-Fa-f]\" # flat address, no compressed words FLAT="^$\(:$\)\$" # ::'s compressions excluding beginning and end edge cases COMP2="^\($:\)\\(:$\)\$" COMP3="^\($:\)\\(:$\)\$" COMP4="^\($:\)\\(:$\)\$" COMP5="^\($:\)\\(:$\)\$" COMP6="^\($:\)\\(:$\)\$" COMP7="^\($:\)\\(:$\)\$" # trailing :: edge case, includes case of only :: (all 0's) EDGE_TAIL="^\(\($:\)\\|:\):$" # leading :: edge case EDGE_LEAD="^:\(:$\)\$" is_ipv6 () is_ipv6 $1 if [ $?-eq 1 ]; then exit 0 else echo "Invalid IPv6 address: $1" Folks on the web have got it right too and I definitely took a queue from Vernon Mauery.is a real-time web service API that identifies the location of an IP address from any location in the world.

||

/bin/sh WORD="[0-9A-Fa-f]\" # flat address, no compressed words FLAT="^$\(:$\)\$" # ::'s compressions excluding beginning and end edge cases COMP2="^\($:\)\\(:$\)\$" COMP3="^\($:\)\\(:$\)\$" COMP4="^\($:\)\\(:$\)\$" COMP5="^\($:\)\\(:$\)\$" COMP6="^\($:\)\\(:$\)\$" COMP7="^\($:\)\\(:$\)\$" # trailing :: edge case, includes case of only :: (all 0's) EDGE_TAIL="^\(\($:\)\\|:\):$" # leading :: edge case EDGE_LEAD="^:\(:$\)\$" is_ipv6 () is_ipv6 $1 if [ $?

-eq 1 ]; then exit 0 else echo "Invalid IPv6 address: $1" Folks on the web have got it right too and I definitely took a queue from Vernon Mauery.

is a real-time web service API that identifies the location of an IP address from any location in the world.

Global coverage includes Africa, Asia, Australia, Europe, North America and South America.

The only thing it lacks is a final check at focus out for a complete ip (since now it allows partial match to let the user type it in.

It would be easy to add, just pass a %V from the -vcmd option & add extra arg to func then do primarily the same checks except force the length to be exactly 4 and don't do the trick of letting the last one blank.

This is added to the flags passed with the | bitwise operator.

For example: From my own testing I have discovered that combining FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6 (i.e.

if [ $?-eq 1 ]; then exit 0 else echo "Invalid IPv6 address:

/bin/sh WORD="[0-9A-Fa-f]\" # flat address, no compressed words FLAT="^$\(:$\)\$" # ::'s compressions excluding beginning and end edge cases COMP2="^\($:\)\\(:$\)\$" COMP3="^\($:\)\\(:$\)\$" COMP4="^\($:\)\\(:$\)\$" COMP5="^\($:\)\\(:$\)\$" COMP6="^\($:\)\\(:$\)\$" COMP7="^\($:\)\\(:$\)\$" # trailing :: edge case, includes case of only :: (all 0's) EDGE_TAIL="^\(\($:\)\\|:\):$" # leading :: edge case EDGE_LEAD="^:\(:$\)\$" is_ipv6 () is_ipv6 $1 if [ $?-eq 1 ]; then exit 0 else echo "Invalid IPv6 address: $1" Folks on the web have got it right too and I definitely took a queue from Vernon Mauery.is a real-time web service API that identifies the location of an IP address from any location in the world.

||

/bin/sh WORD="[0-9A-Fa-f]\" # flat address, no compressed words FLAT="^$\(:$\)\$" # ::'s compressions excluding beginning and end edge cases COMP2="^\($:\)\\(:$\)\$" COMP3="^\($:\)\\(:$\)\$" COMP4="^\($:\)\\(:$\)\$" COMP5="^\($:\)\\(:$\)\$" COMP6="^\($:\)\\(:$\)\$" COMP7="^\($:\)\\(:$\)\$" # trailing :: edge case, includes case of only :: (all 0's) EDGE_TAIL="^\(\($:\)\\|:\):$" # leading :: edge case EDGE_LEAD="^:\(:$\)\$" is_ipv6 () is_ipv6 $1 if [ $?

-eq 1 ]; then exit 0 else echo "Invalid IPv6 address: $1" Folks on the web have got it right too and I definitely took a queue from Vernon Mauery.

is a real-time web service API that identifies the location of an IP address from any location in the world.

Global coverage includes Africa, Asia, Australia, Europe, North America and South America.

The only thing it lacks is a final check at focus out for a complete ip (since now it allows partial match to let the user type it in.

It would be easy to add, just pass a %V from the -vcmd option & add extra arg to func then do primarily the same checks except force the length to be exactly 4 and don't do the trick of letting the last one blank.

This is added to the flags passed with the | bitwise operator.

For example: From my own testing I have discovered that combining FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6 (i.e.

" Folks on the web have got it right too and I definitely took a queue from Vernon Mauery.is a real-time web service API that identifies the location of an IP address from any location in the world.

I haven’t taken on any of the weirdness that are mixed hexadecimal and dot decimal notations … # It currently doesn't work due to a problem figuring out how to impose # the range values of the regular expression onto the values being entered # by the user, so that one can only enter valid IP addresses.



I've also managed to check some of the smaller acid house revival events in the North West. Personally, I've got a big big love of old goa trance. I used to spin (or try to because honestly i was crap!… continue reading »


Read more