Make sure the file found is ending with the search pattern