Skip to content

Instantly share code, notes, and snippets.

@truekonrads
Created August 9, 2013 12:16
Show Gist options
  • Save truekonrads/6193168 to your computer and use it in GitHub Desktop.
Save truekonrads/6193168 to your computer and use it in GitHub Desktop.
Read files and stdin and output all IP addresses
#!/usr/bin/perl -wn
@a=split /[^\d.]/;
foreach (@a){
print "$1\n" if m!^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$!;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment