python 字符串中怎样过滤出一连串的数字

img

import pytesseract
from PIL import Image
if __name__ == '__main__':
    text = pytesseract.image_to_string(Image.open('numbers.png'), lang='eng')
    print(text)

需要提取编号,OCR处理后
‘’‘’

t+: 100007349322
Rte th 32> & term,
‘’‘’
怎样在其中提取出100007349322
而且每次截屏位置不是很固定,
下一次可能变成
‘’‘’
e th 32
434gjh
t+:100007349322
‘’‘’‘
有什么方法,过滤出12位连续的数字?


mo=re.findall(r'\d{12}',str)

python正则表达式re模块了解一下,语法\d+就行