[Tutor] re.findall parentheses problem

Michael Powe michael at trollope.org
Tue Sep 14 20:49:27 CEST 2010


On Tue, Sep 14, 2010 at 01:09:21PM -0400, Michael Scharf wrote:

> Thank you.  I should have figured "groups" were the paren groups.  I see it
> clearly now.  And your solution will work for the larger thing I'm trying to
> do --- thanks.
 
> And yes: I know this matches some non-date-like dates, but the data is such
> that it should work out ok.

Hello,

I second the advice to use named groups.  This option makes it sooo
much easier to retrieve your captures; especially, if you have nested
groups. No more working out if the capture you want is in group 1 or
group 3.  Just matcher.group('January').

Thanks.

mp

-- 
Michael Powe		michael at trollope.org		Naugatuck CT USA
"We had pierced the veneer of outside things.  We had `suffered,
starved, and triumphed, groveled down yet grasped at glory, grown
bigger in the bigness of the whole.'  We had seen God in his
splendors, heard the text that Nature renders.  We had reached the
naked soul of man." -- Sir Ernest Shackleton, <South>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tutor/attachments/20100914/888e1c75/attachment.pgp>


More information about the Tutor mailing list