如何從Python中的字符串中提取數字?我會提取字符串中包含的所有數字。哪個更適合用于目的、正則表達式或isdigit()方法?例子:line = "hello 12 hi 89"結果:[12, 89] 查看完整描述