Python Include char every x positions
Question: I want to include a char every 2 positions, to be specific, I have a MAC
address this way: 00ffabcafe4c and I want it to be 00:ff:ab:ca:fe:4c

Any idea¿? Thank you in advance


Answer: 
    import re
    x="00ffabcafe4c"
    print re.sub(r"(\w{2}(?!$))",r"\1:",x)
    

Output:`00:ff:ab:ca:fe:4c`

