I have the problem with this string
'4.0718393*nt(placement5,placement6)+4.021677*nt(placement4)'
and want have this result
[4.0718393, 4.021677]
Simply said, I want to extract the numbers outside the parentheses in python. I found this regex pattern which will extract every number in a string and is not helping me get further.
re.findall("[-+]?\d+[\.]?\d*[eE]?[-+]?\d*", string)
Much appreciated!
>Solution :
Does this answer your question?
import re
text = '4.0718393*nt(placement5,placement6)+4.021677*nt(placement4)'
matches = re.findall(r"\d+\.\d+", text)