Also, even if we assume it should return a match (which I think it shouldn't), then there's a second bug in print_line_middle, because why would it print anything if there was no match?

Best regards,
Tomasz Dziendzielski