in reply to Re: Re: Re: Can you spot the problem?
in thread Can you spot the problem?

From the Regexp::Common::net docs:

$RE{net}{IPv4}

Returns a pattern that matches a valid IP address in "dotted decimal"

So it only matches the traditional dotted-quad form of IPv4 addresses. That's just one format IPv4 can come in (albeit the most common). There are modifiers Regexp::Common allows for some other formats (like "dotted hex"), but not all possible formats (a simple 32-bit number, for example).

----
: () { :|:& };:

Note: All code is untested, unless otherwise stated

Replies are listed 'Best First'.
Re: Can you spot the problem?
by Abigail-II (Bishop) on Mar 09, 2004 at 12:58 UTC
    There are modifiers Regexp::Common allows for some other formats (like "dotted hex"), but not all possible formats (a simple 32-bit number, for example).
    Yeah, it's true that IP addresses can be given as a 32-bit number, and while I've encountered such IP addresses many times, it's always as data in a program, or binary data between programs. I've never found myself parsing 32 bit numbers out of a file, to get the IP address.

    Abigail