Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Little Python script to dump IP addresses from a file
import sys, re
f = open(sys.argv[1],'r')
text =
ips = []
regex = re.findall(r'\b(?:\d{1,3}\.){3}\d{1,3}\b',text)
if regex is not None:
for match in regex:
if match not in ips:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment