proccess_line(): improve regular expressions

Also, do other cleanups on this function.
Fix typo in function's name
Compile parsing regular expressions
Rename function: process_line to parse_line
Rename variable: filename to filepath