>> I wrote:
>>
>>>>>> import re;re.match('(a+)(ab)','aaab').groups()
>>> ('aa', 'ab')
>>> 
>>> this is the sort of behaviour i'd expect from 
>>>    '(a+?)(ab)'
>>> 
>>> a+ should greedily consume a's at the expense of the string
>>> not matching
>
> Fredrick wrote:
> that's a misunderstanding of what a regular expression is, though: 
> conceptually, a RE describes a set of strings, and the RE engine is 
> designed to answer the question "does this string belong to this
> set".

if that's so, what is the point of +? and *?   (?)

seems to me it's a bit more pragmatic than pure set membership



jack
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to