Match patterns in files in a given directory