clean up net validator

A few issues, overloaded function, and bitwise whitespace
This commit is contained in:
Thomas S Hatch 2013-10-15 14:59:14 -06:00
parent ad44000948
commit 9ead14c18e

View File

@ -3,9 +3,11 @@
Various network validation utilities
'''
# Import python libs
import re
def mac(mac):
def mac(addr):
'''
Validates a mac address
'''
@ -13,5 +15,5 @@ def mac(mac):
(^([0-9A-F]{1,2}[-]){5}([0-9A-F]{1,2})$
|^([0-9A-F]{1,2}[:]){5}([0-9A-F]{1,2})$)
''',
re.VERBOSE|re.IGNORECASE)
return valid.match(mac) is not None
re.VERBOSE | re.IGNORECASE)
return valid.match(addr) is not None