import retext = r'Node57Name123.grpObject12.grp23Symbol43.shape52.anotherobject25.shape23'print( re.sub(r'^([^.]*\.)|\d+(?![^.])', r'\1', text) )
Standard input is empty
Node57Name123.grpObject.grp23Symbol.shape.anotherobject.shape
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!