str = "4,5cm x55x 22cm "; str = str.replace('cm', '').replace(' ', '').split('x') # ['4,5', '55', '22'] str = 'cm x '.join(str)+"cm" print str # retorna 4,5cm x 55cm x 22cm