Move compilation of line-parsing regexp out of inner loop

Using re.compile() to compile the line-parsing regexp out of the inner
loop (which is executed several thousands of times) allows to cut the
execution time by 40%. Still not as good as the original awk script, but
getting better.