I created a quick Regular Expressions (Regex) quiz to help students with a basic understanding of Regex begin to understand patterns that it can be applied to. You can find the google doc version of this quiz here. If you are not familiar with Regex already you can view a tutorial here.
For those who prefer to see the questions directly on TekDefense, here they are:
1. Write a Regular Expression that will match a date that follows the following standard “YYYY-MM-DD”.
2. Write a Regular Expression that will match a traditional SSN.
3. Write a Regular Expression that will match an IPv4 address.
4. Write a Regular Expression that will match an email address.
5. Given the example text that follows, which of the Regular Expressions will match only the MD5 hashes. Circle all that apply.
db9118916aa2fe73bf3b35eadc19b728 ./YHM Phantom.JPG
21667be06c1274fc460f9999054977f9 ./Fit Tester.JPG
9f823495a72bf9dd57c46c1516a8ada7 ./Simple22 - FCGPins^gen2-1.STL
3a78812c085baedad73cdb0223a1b6ef ./BARREL - 5in (.40 S+W)(SPRINGFIELD XD TACTICAL
6457743d2008849a2251d79350e60eef ./Renderings/MAC 10 SMG 001.JPG
1086eff0e881ad35e672f1db83b490c7 ./Renderings/Glock-22 Suppressor.JPG
48ac39a820cea6e7c35deecaff6f945b ./Renderings/Flash Hider.JPG
60135661c95ee2f9e50a4516b0781c66 ./Renderings/Magazine view 420120101-16245-1yqg4mg.jpg
6. From your answer to question 5 which of the valid Regular Expressions for an MD5 hash is the most specific and reusable for finding MD5 hashes in the future.
** Warning Answers below this line **
Answers: Keep in mind that as this is Regex, there are many right answers. If you have something different than what I have below it may still be right. The best way to check is to test it out. You can test with Notepad++ or take a different route such as RegExr. The answer to the fourth question will not work with all email addresses. There are much more complex expressions that will catch a greater sum of the email addresses. This one is focused on the format of firstname.lastname@example.org.
5. A,B, and C