Here is an example of my input sentences. I want to extract numbers from sentences which ends with mm or cm. Here is the regular expression I have tried to make.
sen = 'The study reveals a speculated nodule with pleural tagging at anterior basal segment of LLL, measured 1.9x1.4x2.0 cm in size'
re.findall(r'(\d+) cm',sen)
This gives the output as
['0']
Then I just tried to extract numbers without conditions as
print (re.findall('\d+', sen ))
This gives the output as
['1', '9', '1', '4', '2', '0']
My expected output is
['1.9x1.4x2.0'] or ['1.9', '1.4', '2.0']
Not duplicate because I am also looking for a way to cm, mm plus float numbers.