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 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
6,325 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?