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 Groups

Jimmy Sweeney
Jimmy Sweeney
5,649 Points

No offense, Kenneth, but this is not good instruction.

These videos need to be updated. Please break it down further. The instructor needs to isolate the variables more. I find myself having no idea how or why these regular expressions are working. I would suggest starting with a much simpler .txt file and going through the instructions with much more explicit explanation. For example, what do the $ and ^ do? Show examples of changing one thing at a time instead of writing a whole line of code then saying "look it worked, that's neat". Please explain why it worked!

Sorry for the rambling, but this is frustrating.

1 Answer

regexr.com is a useful tool to break down regex and use it in a sandbox.

^ and $ could mark the beginning and the end of a search pattern, by the way.

Jimmy Sweeney
Jimmy Sweeney
5,649 Points

Thanks Zimri. That website is definitely useful.

I still don't understand what ^ and $ mean really but I'm sure I'll figure it out at some point.

Jimmy Sweeney
Jimmy Sweeney
5,649 Points

I also found this site: https://regex101.com/

You can choose Python as the programming flavor. Just fiddling around with these sandboxes turned out to be the key for me understanding all of this. Thanks again, Zimri.

justlevy
justlevy
4,673 Points

Good resource Zimri Leijen

Should we select JavaScript RegExp or PCRE via PHP if we're learning Python? Probably PCRE since it's server side and closer to PERL?