From: "Pierre-Andre M." Date: 2012-12-29T10:04:31+09:00 Subject: Re: "unless" with Regex That worked perfectly thank you....as a follow up, for some reason the filename "." and ".." are still showing their pesky heads through: I tried elimating them using the same syntax but didnt work: if name != /^\.{1,}$/ here is the whole code-snippet: Dir.foreach("/Volumes/gac_repo/video") do |folder_names| if folder_names =~ /^\d{4}$/ year = folder_names puts "The folder name is: #{year}" Dir.foreach("/Volumes/gac_repo/video/#{year}") do |name| if name != /^\.{1,}$/ puts "The file name is #{name}" end end end end -- Posted via http://www.ruby-forum.com/.