import re input = "Hola B2B 234234 2.2.2 Amigo"cleaned = re.sub(r"(^| )\d[.\d]*\b", "", input)print('"' + cleaned + '"')
Standard input is empty
"Hola B2B Amigo"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!