Python re 字符串提取数字

pattern = 'fsafasfs4gsag6asght4'
result = ''.join(re.findall(r'\d+', pattern))
print(result)

  

posted @ 2024-06-04 15:15  究极不吃香菜  阅读(12)  评论(0编辑  收藏  举报