>>> import re>>> string1 = "498results should get">>> int(re.search(r'd+', string1).group())498
如果字符串中有多个整数:
>>> map(int, re.findall(r'd+', string1))[498]

>>> import re>>> string1 = "498results should get">>> int(re.search(r'd+', string1).group())498
如果字符串中有多个整数:
>>> map(int, re.findall(r'd+', string1))[498]