[Python-bugs-list] [ python-Bugs-416677 ] re.groups misbehaviour
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 17 Apr 2001 06:01:49 -0700
Bugs item #416677, was updated on 2001-04-17 06:01
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=416677&group_id=5470
Category: Regular Expressions
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Andreas Jung (ajung)
Assigned to: Nobody/Anonymous (nobody)
Summary: re.groups misbehaviour
Initial Comment:
import re
pat = "[0-9][0-9]"
s="22 the quick 100 brown fox jumps 44 over the xx lazy 33 dog"
r = re.compile(pat)
mo = r.match(s)
print mo.groups()
print mo.group(0)
I expected that mo.groups() returns for this testcase a tuple with 3 elements ('22','44','33)
but instead it returns (). mo.group(0) returns as expected '22'.
Is this a bug or an error in the documentation ?
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=416677&group_id=5470