Regular Expressions: Parsing Mailing List Data

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Many regex engines also include the ability to create basic if-then-else statements, setting it so certain parts of the expression only match if specific parameters are met, allowing us to use a single expression to match a variety of options; this allows us more flexibility in how we write and use our expressions.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create `mailing-list-report.txt`.

Save the matched data to mailing-list-report.txt.

Extract the “From” and “Subject” lines from the mailing list data.

Craft a regular expression that extracts the desired data from the mailing list mbox file.

Additional Resources

You are a member of EtherCloud, a web hosting company. It is the end of the month, and your manager is looking for a report on the activity for the internal mailing list. She wants a simple list of all the sent messages and who sent them. You have the mailbox file for the month downloaded locally, so all that's left is to do is write the regular expression that will extract the desired content from the file. Save the file of information as mailing-list-report.txt.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?