Created
December 31, 2013 18:46
-
-
Save m13253/8200768 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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