import re

# \d+ 匹配字符串中的数字部分,返回列表

ss = 'adafasw12314egrdf5236qew'
num = re.findall('\d+',ss)
print(num)
#运行结果
#['12314', '5236']

\d+使用匹配数字