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

regex email groups task one question (python)

here is my code:

contacts = re.search(r'(?P<email>[\w\d.+]+@[\w\d.]+), (?P<phone>\d{3}-\d{3}-\d{4})',string, re.VERBOSE)

I am getting 'Bummer! Didn't get a regex search object.'

what am I doing wrong?

1 Answer

Hi Steven,

I believe you can fix this one of two ways. Either remove the verbose flag or escape the space - after the comma. Verbose will ignore implicit spaces.

Kind Regards

thanks! this helped me, too! one thing that's confusing, though, is the fact that it says "the comma and space should not be there" and yet, i passed by putting them there! weird...

EDIT: i just took another look at it.. it says that the commas should not be part of the groups! i read the question wrong! thanks, anyway.