First, you were initializing “rows” inside the loop, which meant you
only kept the last line parsed! The regular expression does this:

(.+) matches at least one character (defaults to starting at the
beginning) and save it in the first “capture group”. The parentheses
do that for you. I then refer to it on the next line; the “1” passed
to last_match.
\s+ matches at least one space.
(\d+)$ matches at least one digit at the end of the line ($) and
saves it as the second capture group.