import res = "Text: 0.12345 and -12.34433 and more to come"results = re.split(r"\s*-?[0-9]+\.[0-9]+\s*", s)print(results)
Standard input is empty
['Text:', 'and', 'and more to come']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!