in reply to Matching Sequential IP Addresses
Update: Hmm, probably not what you're looking for...but still, maybe something along these lines, not in a single regexuse Socket qw(inet_aton); my $start = inet_aton('192.168.1.0'); my $end = inet_aton('192.168.1.255'); my @ips_in_range = grep { my $n = inet_aton($_); $n ge $start and $n l +e $end } @ips;
Maybe...sort all ips by inet_aton order uniquely into an array. For all ips that end in ".0", see if the ip 255 slots down in the array is the same but ending in ".255" (then you know you have 0-255).
|
|---|