Added regex patterns to correctly parse input file.