Searching text with regular expressions
At the heart of this challenge lies a text pattern-matching procedure. For such tasks, one would usually reach for regular expressions (also known as regex) to perform this search quickly and efficiently; our case is no different. The tricky part of the task is recognizing the different patterns that we need to find and building the infrastructure around these patterns so we can extract the relevant bits of data that we need. Some of the patterns will be very simple, while others will be more complex. The tricky part is that there are many patterns for each of the different pieces of data we need to find (date and coordinates). We’re going to tackle these separately rather than using a single pattern for everything. This will carry a small penalty because each string will be checked several times, but this isn’t too bad because the strings involved are relatively short.
The standard library does provide regular expressions...