Skip to content

Instantly share code, notes, and snippets.

@yko
Created April 6, 2010 18:00
Show Gist options
  • Save yko/357885 to your computer and use it in GitHub Desktop.
Save yko/357885 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
my $str = shift @ARGV;
if ($str =~ /(|\d+?)((?:(?:2[1..5][1..5]|1?\d?\d)\.){3}(?:2[1..5][1..5]|1?\d?\d))/) {
if ($1) { warn "Strange ip: $&" }
print "Success: $2\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment