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 Groups

Joe Law
Joe Law
5,040 Points

Confused >.< anyone clarify for me pleasee

Can anyone tell me what is the task 2 of 2 expecting? It says I got @kennethlove, that's what i think it is expecting.....

2 Answers

Martin Cornejo Saavedra
Martin Cornejo Saavedra
18,132 Points

First, you must specify task of which challenge? However, I remember the task you mention, the email-groups from Regular Expressions.

This is the answer I did:

twitters = re.search('''
        (?P<twitter>@[\w]+)$   #twitter

''', string, re.X|re.M)
Joe Law
Joe Law
5,040 Points

noted Martin, thanks for the advice. yeahh, it's from Emails Group challenge task 2 of 2, this is my code... It doesnt seem to work. :(

twitters = re.search(r''' (?P<twitter>\s@[\w]+)$ ''',string, re.X|re.M)

Joe Law
Joe Law
5,040 Points

I'd completed the challenged, by removing the \s.

twitters = re.search(r''' (?P<twitter>@[\w]+)$ ''',string, re.X|re.M) anyone knows what's happening? >.<