Summary
In this chapter, we designed a system of functions that extracts various pieces of information from unstructured text using regular expressions. These were combined with some logic to extract blocks of text separated by blank lines that constitute individual entries in the free-text responses. All these features come together to define a new implementation of the FileReader class from the previous chapter. This means we can now read in all the data provided by the client ready to be processed, which is the content of the next chapter.
This chapter made use of the ctre library, which is a template-only implementation of Perl-compatible regular expressions. This library is nice because it is fast and doesn’t add external library dependencies, but, as we’ve seen, in testing, it adds some complexity to the task. The tests were essential in designing and writing the code for this chapter, as described at many points in the commentary surrounding the code snippets...