Exercise 1: Regular Expression Tutorial

The site regexone.com contains a tutorial and practice problems covering regular expressions. For this exercise you will go through the tutorial and problems. This will give you experience writing REs and discuss details about REs that are not covered in class. Start by reading through the tutorial and then do the practice problems. You will then submit an evidence document of just the practice problems.

More specifically, the evidence document consists of screenshots capturing your answer and the website's response for each of the practice problems. Be careful! The tutorial exercises and the practice problems are similar. The first problem to be captured is shown to the to the right. Note the keyword "Problem" at the top of the page - the tutorial exercises are marked with "Lesson". In addition, note the following:

Specific notes on problems

  1. matching numbers: ensure you match the full number. As a side note, these are Ada-style floating-point constants in that they allow commas.
  2. matching phone numbers: match the full number, but do not match things like (abc) 123-4567
  3. match (capture) just the username (as stated in the problem); do not match the text at or after either the + or the @
  4. match the open < followed by the tag name ("a", "href", etc.) but not any of the text following the tag name or any of the text following the opening tag.
  5. match the full filename, including the extension
  6. follow the directions in the problem statement
  7. match the full log entry, including the "E/" and the line number at the start of the line (allowing for line numbers with 1 or more digits); use capture groups for the appropriate bits within the line
  8. match the full URL, including text after the last /

DoS Attacks

For entertainment, read about how regular expressions can be used for denial of service attacks

Grading Rubric

Approximate penalties for specific, common errors. Novel errors often result in adding to this list.