[issue17257] re module shows unexpected non-greedy behavior when using groups

2013-02-20 Thread Hendrik Lemelson
New submission from Hendrik Lemelson: When using the Python 2.7.3 re module, it shows a strange behavior upon the use of quantifiers together with groups: >>> re.search('(a*)', 'ct').groups() ('',) >>> re.search('(a+)', 

[issue17257] re module shows unexpected non-greedy behavior when using groups

2013-02-21 Thread Hendrik Lemelson
Hendrik Lemelson added the comment: Thank you for clarifying this. While it still not seems really intuitive to me I can handle the behavior. To summarize: It is not possible with re to have an optional ({0,1}) group that contains further subgroups, because re considers (0,0) to already