Pick up a file with some text in it. Write a script (one for each item) that prints out every line from the file that matches the requirement. You can use the script at the end of the page as a starting point but you will have to change it!

#!/usr/bin/env python
from __future__ import print_function

import sys
import re

if len(sys.argv) != 2:
    print("Usage:", sys.argv[0], "FILE")

filename = sys.argv[1]
f = open(filename, 'r')

for line in f:
    print(line, end=" ")

    match = re.search(r'REGEX1', line)
    if match:
       print("   Matching 1", match.group(0))

    match = re.search(r'REGEX2', line)
    if match:
       print("   Matching 2", match.group(0))