Skip to content

Instantly share code, notes, and snippets.

@m13253
Created December 31, 2013 18:46
Show Gist options
  • Save m13253/8200768 to your computer and use it in GitHub Desktop.
Save m13253/8200768 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
if __name__ == '__main__':
import re
try:
while True:
l = input().split()
t = '\n'.join([' '.join(i.split(':', 1)) for i in l if re.match('\\d+\\.\\d+\\.\\d+\\.\\d+:\\d+', i)])
if t:
print(t)
for i in range(len(l)-1):
if re.match('\\d+\\.\\d+\\.\\d+\\.\\d+', l[i]) and re.match('\\d+', l[i+1]):
print(l[i], l[i+1])
except EOFError:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment