在输入下方的第一行表格中需要 exctra 最后一个字

Need exctra last word in first line form below input

我需要使用 python 2.7

输出以下输入数据

这应该适合你:

import re
your_string = "reth10.890"
number = re.findall("\d+\.\d+", your_string)
requested_string = re.sub(number[0], '', a)
print(requested_string)
>>>'reth'

如果您的字符串包含更多浮点数,您必须 select 数字中的最后一个