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

luke hammer
luke hammer
25,513 Points

Name the following group "name". re.search(r'([\s\w]+)', 'Kenneth Love')

I have two questions that are in the quiz?

first

Name the following group "name".

re.search(r'( [\s\w]+)', 'Kenneth Love')

I was doing

re.search(r'(?P<name>[\s\w]+)', 'Kenneth Love')

like I did the challenge but it would either freeze up my browser or fail.

any one else having problems with this not working? is my code correct???

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

Hey Luke, I tried your answer but couldn't get it to freeze up, just give me the "Bummer!"

Your answer is very close. You just left off naming the group:

re.search(r'(?P<name>[\s\w]+)', 'Kenneth Love') #<-- Added <name>
luke hammer
luke hammer
25,513 Points

Thanks for letting me know what I was doing wrong also I attempted this several more times and got it fAil twice more while using Internet Explorer however when I switch to Chrome. chrome seem to work each time.

Chris Freeman
Chris Freeman
Treehouse Moderator 68,423 Points

I recall it was mentioned somewhere on Treehouse that Chrome was the preferred browser. Though I use Firefox (I like the Firebug debugger plugin). And Chrome on the iPhone (like now :-)