Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Regular Expressions in Python Introduction to Regular Expressions Review: Regular Expressions in Python

Dan Badertscher
Dan Badertscher
5,327 Points

match_object.____ (Regular Expressions Quiz)

I've watched the video for this question a few times and i'm still not getting it. Can someone point me in the right direction?

Fill in the blank below:

How would I get the contents of the group named email from my match object?

match_object.__________

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

When named groups are matched in a regex, each result can be referred to by name (See match.group(), if m is your match object, using m.group(name_of_the group). In your case the group name would be 'email'

Sophia Zeng
Sophia Zeng
2,169 Points

I tried to use match_object.group(email), but couldn't get it passed... Chris Freeman, did I get you wrong here??

Chris Freeman
Chris Freeman
Treehouse Moderator 68,441 Points

You are close. email needs to be in quotes:

match_object.group('email')