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 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

sets_email.py
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
MOD
Jason Anders
Treehouse Moderator 145,858 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! :)