regidx: simple file format autodetection