fixed filename checking with regex