Skip to content

Instantly share code, notes, and snippets.

@arobb
Created November 11, 2016 18:58
Show Gist options
  • Save arobb/207cdfa6aa3486dd5aff7d39d6f4a376 to your computer and use it in GitHub Desktop.
Save arobb/207cdfa6aa3486dd5aff7d39d6f4a376 to your computer and use it in GitHub Desktop.
re.findall(r'((?:[0-9a-f-A-F.:]+)(?:[.:]+)(?:[0-9a-f-A-F.:]+))', 'f 2001:0db8:85a3:0000:0000:8a2e:0370:7334 1.1.1.1 ::1 234.34.55.3 fed')
@arobb
Copy link
Author

arobb commented Nov 11, 2016

Also finds malformed addresses that are too long, like 1.2.3.4.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment