>>> r = r"(\d+)\.\d*" >>> s = "3.29 is a number, 4.2 and 0.5 too" >>> re.findall(r,s) ['3', '4', '0']