正则表达式中(\d*)?2和\d*?2的区别

代码:
import re
html="122121232"
a=re.compile("(\d*)?2")
k=re.findall(a,html)
print(k)

b=re.compile("\d*?2")
k2=re.findall(b,html)
print(k2)

出来的结果:
['12212123']
['12', '2', '12', '12', '32']

k的匹配结果为什么是12212123

(\d*)?2

匹配并提取2前面的任意多个数字,越多越好,这个问号是多余的。
\d*?2
匹配2前面的任意多个数字,越少越好。
温馨提示:答案为网友推荐,仅供参考