The `re.search` (here and below) needs to be either a `re.match` or include a
leading `^` in the search pattern to make sure it only grabs this text if it occurs
at the start of a line.