Regular expressions and command-line prompts

Regular expression scanning, replacement, etc

  1. Implement a Python class for regular expression searching, extracting and replacing text.
  2. The constructor of the class should take a file pattern as an argument. It should save (as instance variables) the file pattern and (using the glob module) a list of files that match the pattern.
  1. The class should also contain the following methods:
    • scan(pattern)
    • extract(pattern)
    • replace(pattern, replacement_text) --

What you will learn:

Implementing a command-line prompt

  1. Implement a command-line prompt and command processor by sub-classing cmd.Cmd from the Python standard library.
  2. Implement commands that call each of the three methods in your regular expression class.
  3. Add documentation to each command so that the "help" command can be used to obtain a description of each command.

What you will learn:

Additional information