1>>> import re
2>>> string1 = "498results should get"
3>>> int(re.search(r'\d+', string1).group())
4498
1import re
2s = "12 hello 52 19 some random 15 number"
3# Extract numbers and cast them to int
4list_of_nums = map(int, re.findall('\d+', s))
5print list_of_nums