regex based file format determination, defered creation of bufio reader