# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"([0-9A-f]{2}[:-]){5}[0-9A-f]{2}"
test_str = ("1031AP9 2 AIR-CAP3502I-A-K9 2c:54:2d:0a:1a:1e default location US 10.10.131.108 0 [0 ,0 ,0 ]\n"
"1031AP4 2 AIR-CAP3502I-A-K9 2c:54:2d:0d:d6:d0 default location US 10.10.131.94 1 [0 ,0 ,0 ]\n"
"1031AP5 2 AIR-CAP3502I-A-K9 2c:54:2d:13:04:d5 default location US 10.10.131.107 6 [0 ,0 ,0 ]\n"
"1031AP11 2 AIR-CAP3702I-B-K9 a0:e0:af:6a:80:a4 default location US 10.10.131.106 1 [0 ,0 ,0 ]\n"
"1031AP6 2 AIR-CAP3502I-A-K9 2c:54:2d:13:05:24 default location US 10.10.131.101 1 [0 ,0 ,0 ]\n"
"1031AP2 2 AIR-CAP3502I-A-K9 2c:54:2d:0a:1b:f4 default location US 10.10.131.109 0 [0 ,0 ,0 ]\n"
"1031AP3 2 AIR-CAP3502I-A-K9 2c:54:2d:0a:1a:c6 default location US 10.10.131.104 0 [0 ,0 ,0 ]\n"
"1031AP8 2 AIR-CAP3702I-B-K9 d4:c9:3c:9d:4a:f4 default location US 10.10.131.114 3 [0 ,0 ,0 ]\n"
"1031AP1 2 AIR-CAP3502I-A-K9 2c:54:2d:0d:d7:11 default location US 10.10.131.105 3 [0 ,0 ,0 ]\n"
"1031AP7 2 AIR-CAP3502I-A-K9 2c:54:2d:0a:1c:21 default location US 10.10.131.93 0 [0 ,0 ,0 ]\n"
"1031AP10 2 AIR-CAP3502I-A-K9 2c:54:2d:13:02:53 default location US 10.10.131.103 0 [0 ,0 ,0 ]")
subst = " "
# You can manually specify the number of replacements by changing the 4th argument
result = re.sub(regex, subst, test_str, 0, re.MULTILINE)
if result:
print (result)
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html