2024-10-01 19:26:27 发布
网友
我使用python中的re module使用此regex,得到以下结果:
In [156]: re.findall(r'.*\D(\d{6,7})\D.*', ' f123456 f1234567 ') Out[156]: ['1234567']
…但我想要这个结果:
我不知道怎么形成这个正则表达式。你能帮忙吗?在
简化正则表达式
In [5]: re.findall(r'\d{6,7}', ' f123456 f1234567 ') Out[5]: ['123456', '1234567']
简化正则表达式
相关问题 更多 >
编程相关推荐