I have the following code:
text = str('''\
num1 - 1.23
num2-3.21
num3 - 9.31\
''')
re.findall(r'[\d.]+', str([i for i in text.split('\n')]))
Please note how num2 did not have any spaces.
This returns:
['1', '1.23', '2', '3.21', '3', '9.31']
However I only want to return a list of the value of each num.
['1.23', '3.21', '9.31']
Does anyone know how I can ignore the first digit attached to num and only retrieve the digits after a space or a hyphen?