Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Regular Expressions in Python Introduction to Regular Expressions Email

Stuck on Email Challenge in Python

I think I am doing everything correctly. However, the computer tells me, 'Bummer! unexpected end of regular expression". Could someone explain to me what I am doing wrong

import re

# Example:
# >>> find_email("kenneth.love@teamtreehouse.com, @support, ryan@teamtreehouse.com, test+case@example.co.uk")
# ['kenneth@teamtreehouse.com', 'ryan@teamtreehouse.com', 'test@example
def find_emails(string):
  return re.findall(r'{-\w\d+.]+@[-\w\d.}+', string)

1 Answer

Jason Anders
Jason Anders
Treehouse Moderator 145,627 Points

Hey Hilary,

You've pretty much got it, except for 2 typos (Hitting the shift key when you shouldn't is something I'm bad for too.).

In your regular expression, you have an opening curly brace when it should be square bracket in the first set, and you have an opening square bracket and a closing curly brace instead of a square bracket in the second set.

Fix those up and you're good to go. Keep Coding! :)