您能看看这些正则表达式并解释其输出吗?

问题描述

您能否看一下下面的表达式和输出对,并告诉我它们有何不同?

1。

numregex=re.compile(r'\d{3}')
numregex.findall('the num is 123431532524542524')

output>>['123','431','532','524','542','524']
numregex=re.compile(r'(\d){3}')
numregex.findall('the num is 1232143892432')

output>>['3','4','9','3']
numregex=re.compile(r'(\d\d){3}')
numregex.findall('the num is 123431532524542524')

output>>['31','24','24']

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)