> group != groups
>
> match.group() or match.group(0) gives you a special group that comprises the
> whole match. Regular capturing groups start at index 1, and only those are
> returned by match.groups():
>
> >> re.match("(?:[abc])+", "abc").group() # one group
> 'abc'
> >>> re.match("(?:[abc])+", "abc").groups() # all capturing groups
>
> ()
>
> Peter


Aaargh! Should have caught that myself. Sorry for wasting all your
time. Thank you Peter and Miles! (I am off to bed now. 4:10 am :)


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

Reply via email to