Home Assignments Lecture Blog Resources Discussion Group

Kronos Time Clock: Introduction to Regular Expression Parsing

In this assignment, we begin the analysis of the Kronos InTouch time clock log by using regular expressions to parse the file.


Here is a summary of the whole assignment:

  1. Verify device boot up timing.
  2. Verify device startup services.
  3. Verify device software upgrades.

In this portion of the assignment, we will only be doing (1) boot up timing.

Your job is to read in an entire InTouch log and report:

  • each startup
  • whether it completed
    • if so, how much time it required
  • whether it failed

Your output should begin with the line number of the startup message (log.c.166) server started, the timestamp of the startup, and either: success followed by elapsed time, or failure.

  • Success is determined by a line containing the string oejs.AbstractConnector:Started SelectChannelConnector that follows the startup message.
  • Failure is determined by another startup message before the success message, or end of file.

Each of these output reports should be on a single line.

The whole assignment may be viewed here: Attach:Intouch Startup Log Parsing 2015.pdf

Here is sample code to get you started: Attach:stdin_boost.cpp
The code will read a regex from stdin, and then let you type input strings which are matched against the regex.


  • While it's possible to do the assignment without the use of regular expressions, the point of this assignment is to learn about regular expressions.
Therefore it is required that you use the C++ regular expression (regex) library.
./ps7a device1_intouch.log

and your code should would produce a file named device1_intouch.log.rpt.


Submit the following:

  • Your source code .cpp file and any header file(s).
  • A Makefile for building the code.
  • Output from running your code on each of the five InTouch log files. Your output files must be named device[1-5]_intouch.log.rpt.
  • A filled-out copy of the Attach:ps7a-readme.txt file.

Submit as follows:

Grading Rubric

core implementation4full & correct implementation=4 pts; nearly complete=3pts; part way=2 pts; started=1 pt
use of Boost time methods2please use them
output files included2full & correct = 2 pts; partial = 1 pt; absent = 0 pt
Makefile2Makefile included
Readme42 pts for describing regexs in readme; 2 pts for discussion