0

I have list of MAC Address I try with https://regex101.com/ and it match all 3 address but when I execute it in Python, it print only match of group

text = """20:0C:C8:0D:51:FE
75:85:2B:2B:80:38
75-85-2B-2B-80-38
"""
x = re.findall(
    r"^([0-9A-Fa-f]{2}[:-]?){6}", text, re.M)
  • input : ['FE', '38', '38']
  • expected input : ['20:0C:C8:0D:51:FE','75:85:2B:2B:80:38','75-85-2B-2B-80-38']
Joyp
  • 1

0 Answers0