import re text='''Suppose my Phone No.is 0535-1234567, yours is 010-12345678, his is 025-87654321.''' matchResult=re.findall(r'(\d{3,4})-(\d{7,8})',text) #注意大括号内逗号后不能有空格 for item in matchResult: print(item[0],item[1],sep='-')
时间: 2023-12-02 22:02:49 浏览: 115
wqxuetang_downloader-master_suppose7v2_elephant3cl_python_源码.zip
以上代码的输出结果是:
```
0535-1234567
010-12345678
025-87654321
```
阅读全文