Considering that you read in the lines one by one, you'll
never match a pattern spanning more than one line. If the file is short, read in the entire line. If not, use a two-line buffer, applying the regex on the concatenation of the buffer. Alternatively, split the regex in two. Match the first part - if there's a match, read in the next line and match the second part. If the second part matches, record it. If the second part doesn't match,
redo the current iteration.