import res=".42 5.42 5. ."print(re.findall(r'(?=\.?\d)\d*\.\d*', s))
Standard input is empty
['.42', '5.42', '5.']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!