导入re包

import re

定义接收数据的变量

tel = input()

进行正则匹配并打印结果

res = re.sub(r'[^0-9]+', '', tel)
print(res)