📅  最后修改于: 2022-03-11 14:46:04.126000             🧑  作者: Mango
from itertools import groupby
my_str = "hello 12 hi 89"
l = [int(''.join(i)) for is_digit, i in groupby(my_str, str.isdigit) if is_digit]