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

Could someone please explain more clearly why the first attempts returned "None"?

I am new to re and am having trouble catching his meaning when he says things like, "This is a word character. It's too bad it matches that instead of actually words." I'm not sure what "that" is referring too or when \d would work.

Can you post a link to the video?

1 Answer

I'm taking a guess that you're referring to the 'escape hatches' video in the Regular Expressions in python course. Regular expressions can be a bit tricky, but allow a way to search for patterns within text. the word character he is referring to is '/w' it doesn't actually match words, it matches with unicode characters. at the beginning of that video he goes over most of the different characters and what they match, so maybe try rewatching that part. if that doesn't work try out regexr.com/ an re playground. Hope this helps!

-Brian