Updated file_regex to include error message capture.