Last active
October 12, 2015 13:58
-
-
Save yannisxu/4037276 to your computer and use it in GitHub Desktop.
Python:MatchIP
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
ipAddrPattern = re.compile('^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$') | |
ip_match = ipAddrPattern.match(ip) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment