Lab 0: Regex in-class activity
This lab is not graded; you will get full credit as long as you submit something on Gradescope. That said, you should treat this as a chance to practice your journaling skills, and we will give you feedback on your submitted journals so that you're more likely to get full credit on the "real" labs!
In addition to letting you practice your journaling, this activity is meant as a way to get everyone caught up with regular expressions (aka regex). Regex is not one of the main topics of CS 159 (and will not be on the exam), but it is an extremely useful tool when working with text data! The problem is, different people in this class may have different levels of prior exposure to regex (maybe for some of you, this is the first you've heard of it). So this is meant as a chance for you to help each other out! Get up, walk around the room, and ask each other for help; regex syntax is so nuanced that there's a good chance one of your peers knows something you don't. And remember, in your journal, be sure to cite anybody you got help from!
Background: RegEx Basics and Syntax
If this is your first time working with regex (or if you just want a refresher), take a quick look at Chapter 2.6 of the J&M textbook (link is to the Chapter 2 PDF; scroll down until you find Section 2.6 "Regular Expressions").
Task: RegEx Practice
Practice regular expressions by playing RegEx Golf.
There is no expectation regarding how many of these you get through. You should of course challenge yourself to get through as many as you can, but that number will undoubtedly be different depending on your level of previous experience with regex. The goal of this exercise is not to master regex (honestly, for future labs I'd recommend using AI to generate regex if you need it, unless the needed regex is very basic and hard to mess up) but instead to get some familiarity with its syntax and build intuition for the kinds of problems it can be used to solve, and also to get some practice with journaling.
Analysis Question #1
Which exercises did you end up finishing? Give us the regex you designed for each one.
Analysis Question #2
Describe how this activity went for you. Were any puzzles particularly challenging, and what made them challenging? Alternately, is there any regex you're particularly proud of devising, and if so, why?
Submitting
There is no code to submit for this exercise (though, please make sure to include the specific regexes you came up with somewhere in your journal). You should just submit your journal on the Gradescope assignment.
(When logged in, completion status appears here.)