Regex file format checking