Below are our regex exercises:
Exercise 1:
Exercise 2:
Exercise 3:
These exercises were a good way for us to get more acquainted with some new concepts that were at first a bit challenging. Exercise 3 was definitely the most difficult of the exercises, but once we played around with it, figuring out the code got significantly easier. We took a lot of inspiration from the code that we used for our Files exercises and thought about how we could “translate” what we had for these exercises into something that would incorporate regular expressions. With these thoughts in mind, regular expressions in Python are truly like learning a language of their own, but they are also incredibly useful in that they allow you to be specific enough to pull out what you want from specific areas of code. Exercise 3 helped us better understand and actually interact with regular expressions, so when we got to Exercises 1 and 2, we were able to use some of what we had already experimented with (both unsuccessfully and successfully) to figure out the code for these exercises fairly quickly. This was a good pair programming exercise and helped us both better understand regular expressions.