import re user_name = "fe85.de19.c116"print ( re.sub( "\\.|(?<=\\w\\w)(?=\\w\\w)" , ":", user_name) )
Standard input is empty
fe:85:de:19:c1:16
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!