From the course: Learning Regular Expressions
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Challenge: Character sets - Regular Expressions Tutorial
From the course: Learning Regular Expressions
Challenge: Character sets
(upbeat music) - [Instructor] It's time for the next challenge assignment. In this challenge, we're going to be using everything that we just learned about character sets. For this challenge assignment, we'll also be using Emerson's self-reliance essay, which is included in the exercise files. You can either open that up and work with it in a text editor, or you can copy and paste it into the regex tool so that we can write expressions against it. Once you have that set up and ready to go, try writing a regular expression that matches both the word lives and lived. Then write a regular expression that matches virtue but not virtues. Also, notice what is the problem in the way that we did this? We'll talk about the problem and later we'll learn the solution to it. But just notice for now that it's not a perfect solution. There are eight numbers that are in the text. The first four are a date at the top. The second…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.